/*
 Theme Name:   Twenty Seventeen Child
 Theme URI:    http://example.com/twentyseventeen-child/
 Description:  Child theme for Twenty Seventeen
 Template:     twentyseventeen
 Version:      1.0.0
 Text Domain:  twentyseventeen-child
*/

/* =Full Width Grid Layout
----------------------------------------------- */
.full-width-posts-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 40px 0;
    background: #fff;
}

.full-width-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

/* 3-column grid layout */
.three-column-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    gap: 40px;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 1400px;
}

/* Grid post items */
.grid-post {
    margin-bottom: 30px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Post thumbnail */
.grid-post .post-thumbnail {
    overflow: hidden;
    margin: 0;
    padding: 16px 0 0 !important;
    order: 2;
}

.grid-post .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.grid-post:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Post content */
.grid-post .entry-header {
    padding: 20px 20px 0 !important;
    margin: 0 !important;
    order: 1;
}

.grid-post .entry-title {
    margin: 0 0 0 !important;
    font-size: 1.2em !important;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0;
    text-transform: uppercase;
}

.grid-post .entry-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.grid-post:hover .entry-title a {
    color: #2b90d9;
}

/* Excerpt container */
.entry-excerpt {
    order: 3;
    padding: 8px 20px 25px !important;
    position: relative;
    font-size: 1.05em;
    line-height: 1.6;
    color: #444;
    overflow: hidden;
    margin: 0;
}

.excerpt-content {
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    max-height: none;
}

.entry-excerpt:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    font-size: 0.95em;
    color: #2b90d9;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 12px;
    background: rgba(43, 144, 217, 0.08);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.read-more:hover {
    text-decoration: none;
    background: rgba(43, 144, 217, 0.15);
    transform: translateY(-2px);
}

/* =Front page & blog/archive unified grid
---------------------------------------------------------- */
.twentyseventeen-panel .three-column-grid,
.blog .three-column-grid,
.archive .three-column-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 40px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 1400px !important;
}

.twentyseventeen-panel .grid-post,
.blog .grid-post,
.archive .grid-post {
    margin-bottom: 0 !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.twentyseventeen-panel .grid-post .entry-title,
.blog .grid-post .entry-title,
.archive .grid-post .entry-title {
    font-size: 1.2em !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
    text-transform: uppercase !important;
}

.twentyseventeen-panel .grid-post .entry-header,
.blog .grid-post .entry-header,
.archive .grid-post .entry-header,
.twentyseventeen-panel .grid-post .post-thumbnail,
.blog .grid-post .post-thumbnail,
.archive .grid-post .post-thumbnail,
.twentyseventeen-panel .grid-post .entry-excerpt,
.blog .grid-post .entry-excerpt,
.archive .grid-post .entry-excerpt {
    padding: 20px 20px 0 !important;
    margin: 0 !important;
}

.twentyseventeen-panel .grid-post .post-thumbnail,
.blog .grid-post .post-thumbnail,
.archive .grid-post .post-thumbnail {
    overflow: hidden !important;
}

.twentyseventeen-panel .grid-post .entry-excerpt,
.blog .grid-post .entry-excerpt,
.archive .grid-post .entry-excerpt {
    font-size: 1.05em !important;
    line-height: 1.6 !important;
    color: #444 !important;
}

/* =Sponsor Widget/Grid
----------------------------------------------- */
.sponsor-widget {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
    justify-items: center;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.sponsor-widget .wp-block-image {
    margin: 0 !important;
    padding: 0;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.sponsor-widget .wp-block-image img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    filter: grayscale(100%);
    transition: filter 0.15s ease, transform 0.2s ease;
}

.sponsor-widget .wp-block-image img:hover {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.sponsor-widget .wp-block-gallery {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    grid-auto-rows: minmax(100px, auto);
    height: 200px;
    overflow: hidden;
}

/* =Social Menu & Navigation Fixes
----------------------------------------------- */
.navigation-top .wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    transition: flex-direction 0.3s ease;
}

.social-menu-container {
    display: flex !important;
    margin-left: 20px !important;
    width: auto !important;
    min-width: max-content !important;
    overflow: visible !important;
    transition: opacity 0.75s ease, visibility 0.75s ease;
}

.scrolled-down .social-menu-container { opacity: 1; visibility: visible; }
.scrolled-up .social-menu-container { opacity: 0; visibility: hidden; }

.social-navigation,
.social-links-menu { display: flex !important; width: auto !important; }

.social-links-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-width: max-content !important;
    white-space: nowrap !important;
}

.social-links-menu li {
    display: flex !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    position: static !important;
    float: none !important;
    width: auto !important;
}

.social-links-menu a { display: block !important; }

.footer-social-navigation { display: none !important; }

/* =Footer Widgets
----------------------------------------------- */
.widget-area .widget-column.footer-widget,
.site-footer .widget-column:first-child {
    width: 100%;
    float: none;
}

.site-footer .widget-column:nth-child(2) { display: none; }
.site-footer .wrap { max-width: 100%; padding-left: 0; padding-right: 0; }

/* =Responsive Adjustments for HOME PAGE ONLY
----------------------------------------------- */
@media (max-width: 1400px) {
    .full-width-grid { padding: 0 40px; }
    .home .three-column-grid { max-width: 1200px; grid-template-columns: repeat(3, minmax(280px, 1fr)); }
}

@media (max-width: 1200px) {
    .home .twentyseventeen-panel .grid-post .entry-title {
        font-size: 1.1em;
    }
}

@media (max-width: 1000px) {
    /* Home page only - 2 columns on tablets */
    .home .three-column-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 30px !important; 
    }
    .full-width-grid { padding: 0 20px; }
}

@media (max-width: 768px) {
    /* Home page only - 1 column on mobile */
    .home .three-column-grid { 
        grid-template-columns: 1fr !important; 
        gap: 20px !important; 
    }
    .grid-post { flex-direction: column; }
    .social-menu-container { margin-left: 10px; }
}

/* Center main home content */
.panel-content .wrap {
    max-width: 1000px !important;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Full-bleed 3-column grid on blog/archive only (menu/title remain centered) */
.blog .site-content .three-column-grid,
.archive .site-content .three-column-grid {
    /* break out of the .wrap and span the viewport */
    width: 100vw !important;
    max-width: none !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;

    /* match your homepage spacing */
    padding: 0 40px !important;
    box-sizing: border-box !important;
}

/* keep your 3-col layout rules; this just ensures columns on wide screens */
.blog .site-content .three-column-grid,
.archive .site-content .three-column-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(280px, 1fr)) !important;
    gap: 40px !important;
}

/* Responsive tweaks so the breakout padding is comfy on small screens */
@media (max-width: 1000px) {
    .blog .site-content .three-column-grid,
    .archive .site-content .three-column-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 0 30px !important;
        gap: 30px !important;
    }
}
@media (max-width: 768px) {
    .blog .site-content .three-column-grid,
    .archive .site-content .three-column-grid {
        grid-template-columns: 1fr !important;
        padding: 0 20px !important;
        gap: 20px !important;
    }
}

/* Hide the "Novinky" headline only on the blog posts page */
.blog .page-title {
    display: none !important;
}

/* Tighter wrap for homepage panels – keeps sections snug */
.home .panel-content .wrap {
    max-width: 100% !important;
    padding: 0 40px !important;
    margin-left: auto;
    margin-right: auto;
}

/* Apply only to pages that are NOT the home page */
body:not(.home) .content-area,
body:not(.home) .site-main,
body:not(.home) .wrap,
body:not(.home) .entry-content {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto;
}

/* =Social Menu Mobile Positioning
----------------------------------------------- */
@media (max-width: 768px) {
    .navigation-top .wrap {
        flex-direction: column !important;
        position: relative;
    }
    
    .social-menu-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 15px 0 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(5px);
        border-top: 1px solid #e5e5e5;
        z-index: 9999 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .social-links-menu {
        justify-content: center !important;
        padding: 0 20px !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
    }
    
    .scrolled-down .social-menu-container,
    .scrolled-up .social-menu-container {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ensure proper spacing at bottom of page */
    .site {
        padding-bottom: 60px !important;
    }
}
