/**
 * Atlas Page Builder - Frontend CSS
 * Lightweight, performance-optimized base styles.
 */

/* ============================
   Reset & Base
   ============================ */

.atlas-page * {
    box-sizing: border-box;
}

.atlas-page {
    width: 100%;
    overflow-x: hidden;
}

/* ============================
   Sections
   ============================ */

.atlas-section {
    width: 100%;
    padding: 60px 20px;
    position: relative;
}

.atlas-section--full {
    padding: 0;
}

.atlas-width--narrow > .atlas-content { max-width: 720px; margin: 0 auto; }
.atlas-width--standard > .atlas-content { max-width: 1140px; margin: 0 auto; }
.atlas-width--wide > .atlas-content { max-width: 1440px; margin: 0 auto; }
.atlas-width--full > .atlas-content { max-width: 100%; }

/* ============================
   Layout
   ============================ */

.atlas-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.atlas-column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .atlas-container {
        flex-direction: column;
    }
    .atlas-column {
        width: 100%;
    }
}

/* ============================
   Headings
   ============================ */

.atlas-heading {
    margin: 0 0 16px;
    line-height: 1.2;
    font-weight: 700;
    color: inherit;
}

.atlas-align-left   { text-align: left; }
.atlas-align-center { text-align: center; }
.atlas-align-right  { text-align: right; }

/* ============================
   Text
   ============================ */

.atlas-text {
    line-height: 1.6;
    margin: 0 0 16px;
    color: inherit;
}

.atlas-text p:last-child {
    margin-bottom: 0;
}

/* ============================
   Images
   ============================ */

.atlas-image {
    margin: 0;
    line-height: 0;
}

.atlas-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================
   Buttons
   ============================ */

.atlas-button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
    line-height: 1.2;
}

.atlas-button--primary {
    background: #6366f1;
    color: #ffffff;
}

.atlas-button--primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.25);
}

.atlas-button--secondary {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.atlas-button--secondary:hover {
    background: #6366f1;
    color: #ffffff;
}

.atlas-button--ghost {
    background: transparent;
    color: inherit;
}

.atlas-button--ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ============================
   Spacer
   ============================ */

.atlas-spacer {
    width: 100%;
    pointer-events: none;
}

/* ============================
   Icon
   ============================ */

.atlas-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================
   Animations (CSS-only, performance-friendly)
   ============================ */

.atlas-anim-fade-in {
    opacity: 0;
    animation: atlas-fade-in 0.6s ease forwards;
}

.atlas-anim-slide-up {
    opacity: 0;
    transform: translateY(20px);
    animation: atlas-slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.atlas-anim-scale-in {
    opacity: 0;
    transform: scale(0.95);
    animation: atlas-scale-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes atlas-fade-in {
    to { opacity: 1; }
}

@keyframes atlas-slide-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes atlas-scale-in {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .atlas-anim-fade-in,
    .atlas-anim-slide-up,
    .atlas-anim-scale-in {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .atlas-button {
        transition: none;
    }
}
