/*
 * modern-layout.css
 * Reusable layout + utility classes (grid, flex, spacing, section, button).
 *
 * Every rule is scoped under .modern, so Bootstrap 3 and the other pages are
 * never affected. Add class="modern" to a page wrapper to opt in.
 *
 * Order: base (desktop) first, then max-width media queries:
 * 1440px, 1024px, 992px, 768px, 576px, 425px.
 *
 * Usage:
 *   <div class="modern">
 *     <section class="section">
 *       <div class="wrap">
 *         <div class="row items-center">
 *           <div class="col-md-6">...</div>
 *           <div class="col-md-6">...</div>
 *         </div>
 *       </div>
 *     </section>
 *   </div>
 */

/* ---------- Wrapper / section ---------- */
.modern .wrap {
    width: 90%;
    max-width: 1310px;
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
}
.modern .section {
    padding: 80px 0;
    background: #fff;
    overflow: hidden;
}
.modern .section-dark {
    background: #000;
    color: #fff;
}
.modern .section-head {
    max-width: 980px;
    margin: 0 auto 56px;
    text-align: center;
}

/* ---------- Row ---------- */
.modern .row {
    --gutter: 30px;
    display: flex;
    flex-wrap: wrap;
    margin-right: calc(var(--gutter) / -2);
    margin-left: calc(var(--gutter) / -2);
}
.modern .row > * {
    box-sizing: border-box;
    width: 100%;
    padding-right: calc(var(--gutter) / 2);
    padding-left: calc(var(--gutter) / 2);
}
.modern .row-wide { --gutter: 72px; }
.modern .row-flush { --gutter: 0px; }

/* ---------- Columns (12 grid) ---------- */
.modern .col-1  { width: 8.33333333%; }
.modern .col-2  { width: 16.66666667%; }
.modern .col-3  { width: 25%; }
.modern .col-4  { width: 33.33333333%; }
.modern .col-5  { width: 41.66666667%; }
.modern .col-6  { width: 50%; }
.modern .col-7  { width: 58.33333333%; }
.modern .col-8  { width: 66.66666667%; }
.modern .col-9  { width: 75%; }
.modern .col-10 { width: 83.33333333%; }
.modern .col-11 { width: 91.66666667%; }
.modern .col-12 { width: 100%; }

/* col-md-*: applies above 992px, full width below */
.modern .col-md-1  { width: 8.33333333%; }
.modern .col-md-2  { width: 16.66666667%; }
.modern .col-md-3  { width: 25%; }
.modern .col-md-4  { width: 33.33333333%; }
.modern .col-md-5  { width: 41.66666667%; }
.modern .col-md-6  { width: 50%; }
.modern .col-md-7  { width: 58.33333333%; }
.modern .col-md-8  { width: 66.66666667%; }
.modern .col-md-9  { width: 75%; }
.modern .col-md-10 { width: 83.33333333%; }
.modern .col-md-11 { width: 91.66666667%; }
.modern .col-md-12 { width: 100%; }

/* col-sm-*: applies above 576px, full width below */
.modern .col-sm-1  { width: 8.33333333%; }
.modern .col-sm-2  { width: 16.66666667%; }
.modern .col-sm-3  { width: 25%; }
.modern .col-sm-4  { width: 33.33333333%; }
.modern .col-sm-5  { width: 41.66666667%; }
.modern .col-sm-6  { width: 50%; }
.modern .col-sm-7  { width: 58.33333333%; }
.modern .col-sm-8  { width: 66.66666667%; }
.modern .col-sm-9  { width: 75%; }
.modern .col-sm-10 { width: 83.33333333%; }
.modern .col-sm-11 { width: 91.66666667%; }
.modern .col-sm-12 { width: 100%; }

/* ---------- Flex utilities ---------- */
.modern .flex            { display: flex; }
.modern .flex-col        { flex-direction: column; }
.modern .flex-wrap       { flex-wrap: wrap; }
.modern .flex-none       { flex: none; }
.modern .items-start     { align-items: flex-start; }
.modern .items-center    { align-items: center; }
.modern .items-end       { align-items: flex-end; }
.modern .justify-start   { justify-content: flex-start; }
.modern .justify-center  { justify-content: center; }
.modern .justify-end     { justify-content: flex-end; }
.modern .justify-between { justify-content: space-between; }

.modern .gap-1 { gap: 8px; }
.modern .gap-2 { gap: 16px; }
.modern .gap-3 { gap: 24px; }
.modern .gap-4 { gap: 40px; }

/* ---------- Spacing / text utilities ---------- */
.modern .m-0  { margin: 0; }
.modern .mt-1 { margin-top: 8px; }
.modern .mt-2 { margin-top: 16px; }
.modern .mt-3 { margin-top: 24px; }
.modern .mt-4 { margin-top: 40px; }
.modern .mb-1 { margin-bottom: 8px; }
.modern .mb-2 { margin-bottom: 16px; }
.modern .mb-3 { margin-bottom: 24px; }
.modern .mb-4 { margin-bottom: 40px; }

.modern .text-left   { text-align: left; }
.modern .text-center { text-align: center; }
.modern .text-right  { text-align: right; }
.modern .text-white  { color: #fff; }

/* ---------- Button ---------- */
.modern .button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: 1px solid #000;
    border-radius: 50px;
    background: #000;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .3s ease, color .3s ease, transform .3s ease;
}
.modern .button:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
}
.modern .button svg path { stroke: currentColor; }

/* ---------- Small round icon buttons (prev / next) ---------- */
.modern .icon-nav {
    display: flex;
    gap: 12px;
}
.modern .icon-nav button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 50%;
    background: #fff;
    color: #000;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease;
}
.modern .icon-nav button:hover {
    background: #000;
    color: #fff;
}
.modern .icon-nav svg {
    width: 20px;
    height: 20px;
}

/* ---------- Scroll reveal (driven by assets/js/modern.js) ---------- */
.js .modern [data-reveal] {
    opacity: 0;
    transition: opacity 1s ease, transform 1s cubic-bezier(.22, 1, .36, 1);
    transition-delay: calc(var(--delay, 0) * 110ms);
}
.js .modern [data-reveal="up"]   { transform: translateY(26px); }
.js .modern [data-reveal="zoom"] { transform: scale(.92); }
.js .modern [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Media queries (desktop first) ---------- */
@media (max-width: 1440px) {
    .modern .wrap { max-width: 1170px; }
    .modern .row-wide { --gutter: 56px; }
}

@media (max-width: 1024px) {
    .modern .section { padding: 64px 0; }
    .modern .section-head { margin-bottom: 40px; }
    .modern .row-wide { --gutter: 40px; }
}

@media (max-width: 992px) {
    .modern .row > [class*="col-md-"] { width: 100%; }
}

@media (max-width: 768px) {
    .modern .section { padding: 48px 0; }
    .modern .section-head { margin-bottom: 32px; }
    .modern .row { --gutter: 24px; }
}

@media (max-width: 576px) {
    .modern .wrap { width: 100%; padding-right: 16px; padding-left: 16px; }
    .modern .row > [class*="col-sm-"] { width: 100%; }
}

@media (max-width: 425px) {
    .modern .section { padding: 40px 0; }
    .modern .button { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .js .modern [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
