/**
 * Custom CSS
 * Additional styles for Seventy Blue theme
 */

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    display: grid;
    place-items: center;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top span { display: none; }
.back-to-top::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid #fff; /* triángulo apuntando hacia arriba */
    transform: translateY(-1px); /* fino ajuste óptico */
}

.back-to-top:hover {
    background-color: var(--color-primary-700);
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Menu toggle button */
.menu-toggle {
    display: none;
    background-color: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 10px 15px;
    cursor: pointer;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media screen and (max-width: 767px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
    }

    .main-navigation.toggled ul {
        display: flex;
    }
}

/* Grid layout for posts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.posts-grid article {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.posts-grid article:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Load more button */
.load-more-container {
    text-align: center;
    margin: 3rem 0;
}

#load-more-posts {
    padding: 12px 30px;
    font-size: 16px;
}

/* Portfolio grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-item-overlay {
    opacity: 1;
}

.portfolio-item-content {
    text-align: center;
    color: #fff;
    padding: 2rem;
}

.portfolio-item-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.portfolio-item-category {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Footer widgets */
.footer-widgets {
    padding: 4rem 0 3rem;
    background-color: #2a2a2a;
}

.footer-widget-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-widget-column .widget {
    color: #ddd;
}

.footer-widget-column .widget-title {
    color: #fff;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.footer-widget-column a {
    color: #ddd;
    transition: color 0.3s ease;
}

.footer-widget-column a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-widget-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget-column ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-widget-column ul li:last-child {
    border-bottom: none;
}

/* Footer info */
.site-info {
    background-color: #1a1a1a;
    padding: 2rem 0;
}

.site-info-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-info-content {
    flex: 1;
}

.site-info-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.site-info-content a {
    color: #fff;
    font-weight: 500;
}

.footer-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.footer-navigation a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-navigation a:hover {
    color: #fff;
    text-decoration: none;
}

@media screen and (max-width: 767px) {
    .footer-widgets {
        padding: 3rem 0 2rem;
    }
    
    .footer-widget-area {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .site-info-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-navigation ul {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}

/* Bloque de búsqueda (Gutenberg) */
.wp-block-search__button.wp-element-button,
.wp-block-search .wp-block-search__button {
    background-color: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 10px 16px;
    border-radius: 6px;
    line-height: 1.2;
    transition: all 0.2s ease-in-out;
}

.wp-block-search__button.wp-element-button:hover,
.wp-block-search .wp-block-search__button:hover {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.wp-block-search__button.wp-element-button:focus,
.wp-block-search .wp-block-search__button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.wp-block-search .wp-block-search__input {
    border-radius: 6px;
}

/* Header sticky + admin bar offset */
body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* Page templates */
.page-template-full-width .content-area {
    width: 100%;
    max-width: 100%;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Accessibility improvements */
.skip-link:focus {
    clip: auto !important;
    height: auto;
    width: auto;
    z-index: 100000;
}

/* Print styles */
@media print {
    .site-navigation,
    .widget-area,
    .site-footer,
    .back-to-top,
    .comments-area {
        display: none;
    }

    .content-area {
        width: 100%;
    }
}
