/* ==========================================================================
   Tinajas Alcázar — versión estática
   Ajustes y pequeños componentes que sustituyen funcionalidades de WordPress.
   Este archivo se carga DESPUÉS de theme.css, así que sus reglas tienen
   prioridad. No contiene ninguna dependencia externa.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Cabecera fija y navegación por anclas
   -------------------------------------------------------------------------- */

/* La cabecera queda pegada arriba al hacer scroll (antes lo hacía smint.js) */
#headercontainer {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
}

/* Desplazamiento suave nativo y margen para que la cabecera no tape el título
   de cada sección al pulsar en el menú. */
html {
    scroll-behavior: smooth;
}

#main-slider,
#featured-title,
#post-title,
#contact-title {
    scroll-margin-top: 96px;
}

@media (max-width: 767px) {
    #main-slider,
    #featured-title,
    #post-title,
    #contact-title {
        scroll-margin-top: 150px;
    }
}

/* Enlace "saltar al contenido" visible solo al enfocar con el teclado */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    background: #009688;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
}

.skip-link:focus {
    left: 10px;
    top: 10px;
    outline: 2px solid #fff;
}

/* Estado activo del menú de la portada (scrollspy) */
.home-navigation li.current-menu-item > a,
.home-navigation li.current-menu-item > a:visited {
    color: #009688;
}

/* --------------------------------------------------------------------------
   2. Slider
   -------------------------------------------------------------------------- */

/* La fuente de iconos que usaba FlexSlider no existía en el tema, así que las
   flechas no se veían. Se sustituyen por iconos de Font Awesome. */
.flex-direction-nav a:before {
    font-family: 'FontAwesome';
    font-size: 30px;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

.flex-direction-nav a.flex-prev:before {
    content: "\f104";
}

.flex-direction-nav a.flex-next:before {
    content: "\f105";
}

.flex-direction-nav a {
    width: 40px;
    height: 40px;
    margin-top: -20px;
    text-align: center;
    line-height: 40px;
    opacity: 0;
    transition: opacity .3s ease;
}

.flexslider:hover .flex-direction-nav a {
    opacity: .85;
}

.flex-direction-nav a:hover {
    opacity: 1 !important;
}

/* El primer slide no debe provocar saltos mientras carga */
#main-slider .slides img {
    width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   3. Valoraciones (antes las gestionaba el plugin kk-star-ratings vía AJAX;
       ahora se muestran como dato estático, sin votación)
   -------------------------------------------------------------------------- */

.static-rating {
    clear: both;
    margin: 24px 0 8px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #777;
}

.static-rating .stars {
    position: relative;
    display: inline-block;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 2px;
    color: #dcdcdc;
    white-space: nowrap;
    vertical-align: middle;
}

.static-rating .stars .stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    color: #f2b01e;
    white-space: nowrap;
}

.static-rating .rating-legend {
    margin-left: 8px;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   4. Imágenes y vídeos dentro del contenido
   -------------------------------------------------------------------------- */

.entry-content img {
    max-width: 100%;
    height: auto;
}

.entry-content iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}

/* Imagen destacada en la cabecera del artículo */
.entry-header .post-featured-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* --------------------------------------------------------------------------
   5. Buscador sin PHP: filtra los artículos en el navegador
   -------------------------------------------------------------------------- */

.widget_search .searchform div {
    display: flex;
    gap: 6px;
}

.widget_search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.widget_search input[type="search"]:focus {
    border-color: #009688;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 150, 136, .15);
}

.widget_search input[type="submit"] {
    flex: 0 0 auto;
    background: #009688;
    color: #fff;
    border: 0;
    border-radius: 3px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s ease;
}

.widget_search input[type="submit"]:hover {
    background: #00796b;
}

/* Aviso de resultados de búsqueda */
.search-notice {
    margin: 0 0 24px;
    padding: 12px 16px;
    border-left: 4px solid #009688;
    background: #f4f7f6;
    font-size: 14px;
    color: #444;
}

.search-notice a {
    color: #00796b;
    text-decoration: underline;
}

.search-empty {
    padding: 24px 0 40px;
    font-size: 16px;
    color: #555;
}

/* --------------------------------------------------------------------------
   6. Barras laterales
   -------------------------------------------------------------------------- */

.widget-contact {
    background: #f7f7f7;
    border: 1px solid #eee;
    padding: 18px;
}

.widget-contact .contact-phone {
    display: inline-block;
    margin-top: 6px;
    background: #009688;
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
}

.widget-contact .contact-phone:hover {
    background: #00796b;
}

.widget-contact .contact-phone .fa {
    margin-right: 6px;
}

.widget-contact .contact-email {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   7. Listado del blog
   -------------------------------------------------------------------------- */

/* Imagen vertical (entradas de formato imagen) recortada como miniatura,
   para que el listado no se alargue en exceso. */
.blog-teaser-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 320px;
    object-fit: cover;
    margin-bottom: 20px;
}

/* Enlaces "Continúa leyendo" del listado */
.entry-summary .more-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. Página 404
   -------------------------------------------------------------------------- */

.error404 .not-found {
    padding: 80px 0 100px;
    text-align: center;
}

.error404 .not-found h1 {
    font-size: 34px;
    color: #009688;
    margin-bottom: 16px;
}

.error404 .not-found p {
    max-width: 620px;
    margin: 0 auto 18px;
    font-size: 16px;
    color: #555;
}

.error404 .button {
    display: inline-block;
    margin-top: 10px;
    background: #009688;
    color: #fff;
    padding: 12px 22px;
    border-radius: 3px;
    text-decoration: none;
}

.error404 .button:hover {
    background: #00796b;
}

/* --------------------------------------------------------------------------
   9. Ajustes varios
   -------------------------------------------------------------------------- */

/* Evita que la página se desplace en horizontal por algún elemento ancho */
img,
iframe,
table {
    max-width: 100%;
}

/* Mejor legibilidad de los párrafos del pie */
.footer-wrap p {
    margin: 0;
}

/* La imagen del mapa no necesita ser enorme */
.contact-map img {
    width: 100%;
    height: auto;
    display: block;
}

/* Botón "volver arriba": el tema lo oculta por defecto y se muestra al
   hacer scroll (antes lo hacía jQuery con fadeIn). */
.back-to-top.is-visible {
    display: block;
}

.back-to-top:hover {
    background-color: #009688;
    color: #fff;
}

/* El número de teléfono de la barra superior es un enlace y el color base del
   tema (#333) lo hacía invisible sobre el fondo oscuro. */
.header-contact a,
.header-contact a:hover,
.header-contact a:focus {
    color: #fff;
    text-decoration: none;
}

.header-contact a:hover {
    text-decoration: underline;
}

/* Separación entre los datos de la cabecera del artículo
   (fecha · autor · categoría) */
.header-meta .post-author {
    margin: 0 14px;
}
