/* ==========================================================================
   LAYOUT.CSS — Layout utilities pre stellasirava.sk
   ========================================================================== */

/* === CONTAINER === */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* === SECTIONS === */

.section {
    padding: var(--space-16) 0;
}

.section-sm {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-24) 0;
}

.section-title {
    text-align: center;
    font-size: var(--text-3xl);
    margin-bottom: var(--space-3);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-12);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

/* === GRID === */

.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* === FLEX === */

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* === TEXT ALIGNMENT === */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* === SPACING UTILITIES === */

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mt-12 {
    margin-top: var(--space-12);
}

.mt-16 {
    margin-top: var(--space-16);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mb-12 {
    margin-bottom: var(--space-12);
}

.mb-16 {
    margin-bottom: var(--space-16);
}

/* === VISIBILITY === */

.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;
}

/* === SECTION TITLE DECORATIONS === */

.section-title {
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    margin: var(--space-4) auto 0;
    border-radius: var(--rounded-full);
    transition: width var(--transition-slow);
}

.section-title:hover::after {
    width: 100px;
}

/* === ANIMATIONS === */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 144, 164, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(74, 144, 164, 0.15); }
}

/* Base fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Directional variants */
.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.fade-in-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.fade-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale variant */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.scale-in.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for grid children */
.stagger-children .fade-in:nth-child(1),
.stagger-children .fade-in-left:nth-child(1),
.stagger-children .fade-in-right:nth-child(1),
.stagger-children .scale-in:nth-child(1) { transition-delay: 0ms; }

.stagger-children .fade-in:nth-child(2),
.stagger-children .fade-in-left:nth-child(2),
.stagger-children .fade-in-right:nth-child(2),
.stagger-children .scale-in:nth-child(2) { transition-delay: 100ms; }

.stagger-children .fade-in:nth-child(3),
.stagger-children .fade-in-left:nth-child(3),
.stagger-children .fade-in-right:nth-child(3),
.stagger-children .scale-in:nth-child(3) { transition-delay: 200ms; }

.stagger-children .fade-in:nth-child(4),
.stagger-children .fade-in-left:nth-child(4),
.stagger-children .fade-in-right:nth-child(4),
.stagger-children .scale-in:nth-child(4) { transition-delay: 300ms; }

.stagger-children .fade-in:nth-child(5),
.stagger-children .fade-in-left:nth-child(5) { transition-delay: 400ms; }

.stagger-children .fade-in:nth-child(6),
.stagger-children .fade-in-left:nth-child(6) { transition-delay: 500ms; }

/* === RESPONSIVE === */

@media (max-width: 767px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .section {
        padding: var(--space-12) 0;
    }

    .section-lg {
        padding: var(--space-16) 0;
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .section-subtitle {
        font-size: var(--text-base);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === REDUCED MOTION === */

@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-left,
    .fade-in-right,
    .scale-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .section-title::after {
        transition: none;
    }
}

/* === ACCESSIBILITY — Comprehensive Motion Preferences === */

@media (prefers-reduced-motion: reduce) {
    /* Global animation and transition disabling */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Ensure fade-in elements are immediately visible */
    .fade-in,
    .fade-in-left,
    .fade-in-right,
    .scale-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* Remove all keyframe animations */
    @keyframes fadeInUp { to { opacity: 1; transform: none; } }
    @keyframes fadeInLeft { to { opacity: 1; transform: none; } }
    @keyframes fadeInRight { to { opacity: 1; transform: none; } }
    @keyframes scaleIn { to { opacity: 1; transform: none; } }
    @keyframes slideUp { to { opacity: 1; transform: none; } }
    @keyframes float { to { transform: none; } }
    @keyframes shimmer { to { background-position: center; } }
    @keyframes pulse-glow { to { box-shadow: none; } }
    @keyframes stepFadeIn { to { opacity: 1; } }
    @keyframes confirmCircle { to { stroke-dashoffset: 0; } }
    @keyframes confirmTick { to { stroke-dashoffset: 0; } }
    @keyframes heroContentIn { to { opacity: 1; transform: none; } }
    @keyframes scrollLine { to { transform: none; } }
    @keyframes decoFloat { to { transform: none; } }
    @keyframes frameFloat { to { transform: none; } }
    @keyframes polaroidFloat { to { transform: none; } }
    @keyframes apertureRotate { to { transform: none; } }
    @keyframes mountainFloat { to { transform: none; } }
    @keyframes sunPulse { to { opacity: 1; transform: none; } }
    @keyframes waveShift { to { transform: none; } }
    @keyframes envelopeFloat { to { transform: none; } }
    @keyframes bubbleFloat { to { transform: none; } }
    @keyframes dotBounce { to { transform: none; } }
    @keyframes decoPulse { to { opacity: 1; transform: none; } }
    @keyframes sealFloat { to { transform: none; } }
}
