/*
Theme Name: SLZH Theme
Theme URI: https://slzh.sk
Author: SLZH
Author URI: https://slzh.sk
Description: Moderná responzívna child téma pre SLZH.sk s optimalizovanou responzivitou pre všetky zariadenia.
Template: twentytwentythree
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Text Domain: slzh-theme
Tags: responsive, modern, optimized
*/

/* ==========================================================================
   CSS PREMENNÉ - Centralizované hodnoty
   ========================================================================== */

:root {
    /* Farby - VŽDY BIELE POZADIE */
    --slzh-primary: #d9121f;
    --slzh-primary-dark: #b71c1c;
    --slzh-primary-light: #ff5252;
    --slzh-secondary: #1a2f5c;
    --slzh-secondary-light: #2a4a8a;
    --slzh-text: #333333;
    --slzh-text-light: #6b7280;
    --slzh-text-muted: #9ca3af;
    --slzh-bg: #ffffff;
    --slzh-bg-light: #f9fafb;
    --slzh-bg-gray: #f3f4f6;
    --slzh-border: #e5e7eb;
    --slzh-shadow: rgba(0, 0, 0, 0.08);
    --slzh-shadow-lg: rgba(0, 0, 0, 0.12);

    /* Typografia - Fluid sizing */
    --slzh-text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --slzh-text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --slzh-text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --slzh-text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --slzh-text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --slzh-text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
    --slzh-text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
    --slzh-text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);

    /* Spacing - Fluid */
    --slzh-space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
    --slzh-space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --slzh-space-md: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --slzh-space-lg: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --slzh-space-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --slzh-space-2xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
    --slzh-space-3xl: clamp(3rem, 2rem + 5vw, 5rem);

    /* Border radius */
    --slzh-radius-sm: 4px;
    --slzh-radius-md: 6px;
    --slzh-radius-lg: 8px;
    --slzh-radius-xl: 12px;
    --slzh-radius-full: 9999px;

    /* Transitions */
    --slzh-transition-fast: 150ms ease;
    --slzh-transition-base: 300ms ease;
    --slzh-transition-slow: 500ms ease;
}

/* ==========================================================================
   GLOBÁLNE ŠTÝLY - BIELE POZADIE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* VYNÚTENIE BIELEHO POZADIA */
body,
body.slzh-theme {
    background-color: #ffffff !important;
    color: #333333;
    font-size: var(--slzh-text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* WordPress site background */
.wp-site-blocks {
    background-color: #ffffff !important;
}

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

/* ==========================================================================
   AKTUALITY - Modernizované karty (zachovaný pôvodný vzhľad)
   ========================================================================== */

.wp-block-latest-posts__list.aktuality {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.wp-block-latest-posts__list.aktuality li {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 300px;
    max-width: 100%;
}

.wp-block-latest-posts__list.aktuality li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Touch zariadenia */
@media (hover: none) {
    .wp-block-latest-posts__list.aktuality li:hover {
        transform: none;
    }
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__featured-image {
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1rem 1rem 0 1rem;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__featured-image img {
    width: auto;
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__featured-image.alignleft {
    float: none;
    margin: 0;
    text-align: center;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__post-title {
    color: #1a2f5c;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    padding: 1rem 1rem 0.5rem 1rem;
    text-decoration: none;
    display: block;
    line-height: 1.4;
    text-align: center;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__post-title:hover {
    color: #d32f2f;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__post-date {
    color: #6b7280;
    font-size: 0.875rem;
    padding: 0 1rem 0.5rem 1rem;
    display: block;
    text-align: center;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__post-excerpt {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 0 1rem 1.5rem 1rem;
    margin: 0;
    flex-grow: 1;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__post-excerpt .wp-block-latest-posts__read-more {
    display: block;
    text-align: center;
    margin-top: 1rem;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__read-more {
    display: inline-block;
    background-color: #d32f2f;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    margin: 0 auto;
    transition: all 0.3s ease;
    text-align: center;
}

.wp-block-latest-posts__list.aktuality .wp-block-latest-posts__read-more:hover {
    background-color: #b71c1c;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
}

.wp-block-latest-posts__list.aktuality .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responzívne štýly pre aktuality */
@media (max-width: 768px) {
    .wp-block-latest-posts__list.aktuality {
        justify-content: center;
    }

    .wp-block-latest-posts__list.aktuality li {
        width: 100%;
        max-width: 300px;
    }
}

/* ==========================================================================
   CONTACT FORM 7 - Formuláre (zachovaný pôvodný vzhľad)
   ========================================================================== */

.wpcf7-form p {
    margin-bottom: 1em;
}

.wpcf7-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="number"],
.wpcf7-form select {
    width: 100%;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 1em;
    padding: 0.8em;
    font-size: 1.1em;
    background-color: #ffffff;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="number"]:focus,
.wpcf7-form select:focus {
    outline: none;
    border-color: #d9121f;
    box-shadow: 0 0 0 3px rgba(217, 18, 31, 0.1);
}

.wpcf7-form input[type="checkbox"] {
    margin-right: 0.5em;
}

.wpcf7-form input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 0.7em 1.5em;
    border: none;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
}

.wpcf7-form input[type="submit"]:hover {
    background-color: #0056b3;
}

/* Responzívne pre menšie obrazovky */
@media (max-width: 600px) {
    .wpcf7-form label {
        font-size: 0.9em;
    }

    .wpcf7-form input[type="text"],
    .wpcf7-form input[type="tel"],
    .wpcf7-form input[type="email"],
    .wpcf7-form input[type="number"],
    .wpcf7-form select,
    .wpcf7-form input[type="submit"] {
        font-size: 0.95em;
        padding: 0.6em;
    }
}

/* ==========================================================================
   EVENTS CONTAINER - Hlavná stránka (zachovaný pôvodný vzhľad)
   ========================================================================== */

.events-container-responsive-mobile-left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.event-panel-responsive-mobile-left {
    display: flex;
    width: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-sizing: border-box;
    align-items: center;
    padding: 10px;
    flex-direction: row;
    background: #FFF;
}

.event-panel-responsive-mobile-left:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (hover: none) {
    .event-panel-responsive-mobile-left:hover {
        transform: none;
    }
}

.event-image-mobile-left {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-right: 10px;
}

.event-image-mobile-left img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-info-mobile-left {
    flex-grow: 1;
    background-color: white;
}

.event-date-mobile-left {
    font-size: 12px;
    font-weight: bold;
    color: #FFF;
    margin-bottom: 3px;
    background-color: #d9121f;
    padding: 10px;
}

.event-title-mobile-left {
    font-weight: bold;
    color: #555;
    background-color: white;
    padding: 1px 0;
}

/* Desktop - 769px+ */
@media (min-width: 769px) {
    .events-container-responsive-mobile-left {
        flex-wrap: nowrap;
    }

    .event-panel-responsive-mobile-left {
        flex-direction: column;
        width: calc(16.666% - 10px);
        align-items: stretch;
        padding: 8px;
    }

    .event-image-mobile-left {
        height: auto;
        aspect-ratio: 1 / 1;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .event-image-mobile-left img {
        object-fit: cover;
    }
}

/* ==========================================================================
   TLAČIDLÁ A LINKY
   ========================================================================== */

li.link_red a span {
    background-color: #d9121f;
    padding: 20px;
    color: #FFF;
    font-weight: bold;
}

li.link_red a:hover span {
    background-color: #b71c1c;
}

/* ==========================================================================
   VYLEPŠENIA RESPONZIVITY - Nové breakpointy
   ========================================================================== */

/* Extra malé zariadenia (320px - 479px) */
@media (max-width: 479px) {
    .wp-block-latest-posts__list.aktuality li {
        width: 100%;
        max-width: none;
    }

    .wp-block-latest-posts__list.aktuality .wp-block-latest-posts__featured-image img {
        height: 150px;
    }

    .wp-block-latest-posts__list.aktuality .wp-block-latest-posts__post-title {
        font-size: 1.1rem;
    }

    .event-image-mobile-left {
        width: 80px;
        height: 80px;
    }

    .event-date-mobile-left {
        font-size: 10px;
        padding: 6px;
    }
}

/* Malé zariadenia (480px - 639px) */
@media (min-width: 480px) and (max-width: 639px) {
    .wp-block-latest-posts__list.aktuality {
        gap: 1rem;
    }

    .wp-block-latest-posts__list.aktuality li {
        width: calc(50% - 0.5rem);
        max-width: none;
    }
}

/* Stredné zariadenia (640px - 767px) */
@media (min-width: 640px) and (max-width: 767px) {
    .wp-block-latest-posts__list.aktuality li {
        width: calc(50% - 1rem);
    }

    .events-container-responsive-mobile-left {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .event-panel-responsive-mobile-left {
        width: 100%;
    }
}

/* Tablety (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .wp-block-latest-posts__list.aktuality li {
        width: calc(33.333% - 1.5rem);
    }

    .events-container-responsive-mobile-left {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .event-panel-responsive-mobile-left {
        flex-direction: column;
        width: 100%;
        padding: 8px;
    }

    .event-image-mobile-left {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        margin-right: 0;
        margin-bottom: 5px;
    }
}

/* Desktop (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .wp-block-latest-posts__list.aktuality li {
        width: calc(25% - 1.5rem);
    }

    .events-container-responsive-mobile-left {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Veľký desktop (1280px+) */
@media (min-width: 1280px) {
    .wp-block-latest-posts__list.aktuality {
        gap: 2rem;
    }

    .wp-block-latest-posts__list.aktuality li {
        width: 300px;
    }

    .events-container-responsive-mobile-left {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ==========================================================================
   WORDPRESS BLOKY - Responzívne vylepšenia
   ========================================================================== */

/* Responzívne obrázky */
.wp-block-image img {
    height: auto;
    max-width: 100%;
}

/* Responzívne tabuľky */
.wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wp-block-table table {
    min-width: 100%;
}

@media (max-width: 640px) {
    .wp-block-table th,
    .wp-block-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Responzívne video embedy */
.wp-block-embed,
.wp-block-video {
    max-width: 100%;
}

.wp-block-embed iframe,
.wp-block-video video {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

/* ==========================================================================
   NAVIGÁCIA - Mobilná optimalizácia
   ========================================================================== */

@media (max-width: 767px) {
    .wp-block-navigation {
        font-size: 0.9rem;
    }

    .wp-block-navigation__responsive-container.is-menu-open {
        background-color: #ffffff !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus štýly */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #d9121f;
    outline-offset: 2px;
}

/* Screen reader only */
.screen-reader-text,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   PERFORMANCE
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   PRINT ŠTÝLY
   ========================================================================== */

@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white !important;
    }

    .wp-block-navigation,
    .wpcf7-form input[type="submit"] {
        display: none;
    }

    a {
        text-decoration: underline;
        color: black;
    }

    .wp-block-latest-posts__list.aktuality,
    .events-container-responsive-mobile-left {
        display: block;
    }

    .wp-block-latest-posts__list.aktuality li,
    .event-panel-responsive-mobile-left {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}
