/* ============================================
   poroCity — Tool Page
   ============================================ */

/* ---- Gate ---- */
.tool-gate__intro {
    max-width: var(--content-narrow);
    margin: 0 auto var(--space-md);
    text-align: center;
}

.tool-gate__intro p {
    margin-left: auto;
    margin-right: auto;
}

.tool-gate__intro h2 {
    margin-bottom: var(--space-sm);
}

.tool-gate__actions {
    text-align: center;
    margin-top: var(--space-md);
}

.tool-gate__note {
    margin: var(--space-sm) auto 0;
    max-width: 480px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.tool-content--hidden {
    display: none;
}

/* ---- Tab bar ---- */
.tool-tabs {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

/* ---- Iframe container ---- */
.tool-frame {
    position: relative;
    width: 100%;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tool-frame iframe {
    width: 100%;
    height: 85vh;
    border: none;
    display: block;
}

.tool-frame--hidden {
    display: none !important;
}

/* ---- Loading state ---- */
.tool-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    z-index: 2;
    transition: opacity var(--transition-base);
}

.tool-loading.loaded {
    opacity: 0;
    pointer-events: none;
}

.tool-loading__text {
    font-weight: var(--font-weight-light);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

/* ---- Tool description ---- */
.tool-desc {
    margin-bottom: var(--space-md);
    width: 100%;
}

.tool-desc h3 {
    margin-bottom: var(--space-xs);
}

.tool-desc p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: none;
}

/* ---- Launch-in-new-tab (for tools che non girano bene in iframe) ---- */
.tool-launch {
    position: relative;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: #1a1a1a url('../img/lattice-preview.jpg') center center / 155% auto no-repeat;
    overflow: hidden;
}

.tool-launch::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.55);
    z-index: 1;
}

.tool-launch__inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 520px;
}

.tool-launch__title {
    font-weight: var(--font-weight-bold);
    font-size: 1.8rem;
    margin-bottom: var(--space-xs);
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.tool-launch__text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.tool-launch__btn {
    display: inline-block;
    background: var(--color-sage);
    color: #fff;
    border-color: var(--color-sage);
}

.tool-launch__btn:hover {
    background: #fff;
    color: var(--color-sage);
    border-color: #fff;
}

@media (max-width: 768px) {
    .tool-launch {
        height: 70vh;
    }
}

/* ---- Coming soon placeholder ---- */
.tool-coming-soon {
    width: 100%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: var(--color-white);
}

.tool-coming-soon__title {
    font-weight: var(--font-weight-bold);
    font-size: 1.5rem;
    color: var(--color-text-secondary);
}

.tool-coming-soon__text {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .tool-frame iframe {
        height: 70vh;
    }

    .tool-coming-soon {
        height: 70vh;
    }
}
