/* --------------------------------------------------
   Magazine Template Shared Utilities
   -------------------------------------------------- */
.img-square {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}
.img-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.txt-bar {
    background: #ffffff;
    padding: 1rem;
    line-height: 1.55;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

/* When a txt-bar is empty (no text content), make it unobtrusive */
.txt-bar:empty {
    min-height: 44px; /* keep space visible */
    background: #f9fafb;
    border-left: 2px dashed #d1d5db;
    color: #94a3b8;
    display: flex;
    align-items: center;
    font-style: italic;
}
.txt-bar:empty::before {
    content: 'Add text…';
    margin-left: 0.25rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    min-height: 2.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    padding: 0.25rem;
}

.txt-pill {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #667eea;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.cta-btn {
    background: #667eea;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.cta-btn:hover { background: #5563d4; }
.cta-btn.secondary { background: #4ad0b0; }
.cta-btn.secondary:hover { background: #38b89a; }

.countdown-bar {
    background: #111827;
    color: #10b981;
    font-family: 'Courier New', monospace;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

/* --------------------------------------------------
   Magazine Template Wrappers
   -------------------------------------------------- */
.tpl-triple-kick,
.tpl-masonry-tease,
.tpl-snake-path,
.tpl-floating-islands,
.tpl-step-ladder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Triple-Kick Intro */
.tpl-triple-kick .row-a { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.tpl-triple-kick .row-c { display: grid; grid-template-columns: 1fr 2fr; gap: 0.5rem; }
.tpl-triple-kick .row-f { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; }

/* Masonry Tease */
.tpl-masonry-tease .gap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.tpl-masonry-tease .hero-strip { position: relative; min-height: 200px; display: flex; align-items: flex-end; border-radius: 8px; overflow: hidden; }
.tpl-masonry-tease .headline { position: absolute; bottom: 1rem; left: 1rem; color: #fff; font-size: 1.75rem; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }

/* Snake Path */
.tpl-snake-path .snake-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.tpl-snake-path .mini-quad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.tpl-snake-path .center-sq { width: 100%; height: 260px; }

/* Floating Islands */
.tpl-floating-islands { position: relative; }
.tpl-floating-islands .island-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }
.tpl-floating-islands .background { position: absolute; inset: 0; background: linear-gradient(135deg, #6EE7B7 0%, #3B82F6 100%); border-radius: 12px; opacity: 0.15; }
.tpl-floating-islands .isle-copy { position: relative; z-index: 1; }

/* Step Ladder */
.tpl-step-ladder .step-banner { font-size: 1.25rem; font-weight: 700; padding: 0.75rem 1rem; background: #E0E7FF; border-radius: 8px; }
.tpl-step-ladder .step-row { display: grid; grid-template-columns: auto 120px 1fr; gap: 0.5rem; align-items: center; }
.tpl-step-ladder .milestone-sq { width: 100%; height: 200px; }
.tpl-step-ladder .results-bar { background: #f3f4f6; padding: 0.75rem 1rem; border-radius: 6px; }
.tpl-step-ladder .final-cta { align-self: flex-start; margin-top: 0.5rem; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .tpl-triple-kick .row-a,
    .tpl-masonry-tease .gap-grid,
    .tpl-snake-path .snake-row,
    .tpl-snake-path .mini-quad,
    .tpl-floating-islands .island-grid,
    .tpl-step-ladder .step-row {
        grid-template-columns: 1fr !important;
    }
}
