/* Portfolio project cards (portfolio.html) and project details page (portfolio_detail.html) */

.portfolio-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 4rem 0;
}

/* ---------- Card ---------- */
.project-card {
    background: var(--card-bg-light);
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
}

.project-preview {
    position: relative;
    background: #111;
}

/* Clickable layer over the preview; the iframe underneath never receives clicks */
.preview-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ---------- Browser chrome ---------- */
.browser-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 34px;
    padding: 0 0.75rem;
    background: #1f1f1f;
}

.browser-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.browser-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5f57;
}

.browser-dots i:nth-child(2) { background: #febc2e; }
.browser-dots i:nth-child(3) { background: #28c840; }

.browser-address {
    flex: 1;
    min-width: 0;
    padding: 0.2rem 0.75rem;
    border-radius: 6px;
    background: #2c2c2c;
    color: #bdbdbd;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-open {
    color: #bdbdbd;
    font-size: 0.8rem;
    text-decoration: none;
}

.browser-open:hover {
    color: var(--accent-green);
}

/* ---------- Preview screens ---------- */
.preview-screen {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

/* The site is rendered at 1280x800 and scaled to the card's width (--preview-scale is set in portfolio.html) */
.site-screen {
    background: #f4f4f4;
}

.site-screen iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 800px;
    border: 0;
    background: #fff;
    transform: scale(var(--preview-scale, 0.3));
    transform-origin: 0 0;
    pointer-events: none;
}

.fallback-screen,
.social-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.fallback-screen {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    color: #fff;
}

.fallback-screen i {
    font-size: 2.75rem;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
}

.fallback-screen span {
    font-family: monospace;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    word-break: break-all;
}

.social-screen {
    color: #fff;
    background: #1a1a1a;
}

.social-screen i {
    font-size: 3.25rem;
    margin-bottom: 0.5rem;
}

.social-name {
    font-size: 1.15rem;
    font-weight: 600;
}

.social-handle {
    font-size: 0.85rem;
    opacity: 0.85;
    word-break: break-all;
}

.social-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social-facebook { background: #1877f2; }
.social-x, .social-threads { background: #000; }
.social-linkedin { background: #0a66c2; }
.social-tiktok { background: #010101; }
.social-tiktok i { text-shadow: -3px -2px 0 #25f4ee, 3px 2px 0 #fe2c55; }
.social-youtube { background: #ff0000; }
.social-pinterest { background: #e60023; }
.social-snapchat { background: #fffc00; color: #111; }
.social-github { background: #24292f; }
.social-dribbble { background: #ea4c89; }
.social-behance { background: #1769ff; }

/* ---------- Card body ---------- */
.project-body {
    padding: 1.5rem;
}

.project-kind {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 100px;
    background: rgba(158, 255, 0, 0.2);
    color: #2f5600;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.project-body h3 {
    margin: 0.75rem 0 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

.project-body h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.project-body h3 a:hover {
    text-decoration: underline;
}

.project-description {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.view-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: 100px;
    background: var(--text-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.view-more i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.view-more:hover {
    background: var(--accent-green);
    color: var(--text-primary);
}

.view-more:hover i {
    transform: translateX(3px);
}

.visit-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #555;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.visit-link i {
    font-size: 0.7rem;
}

.visit-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ---------- Details page ---------- */
.project-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.project-hero {
    padding: 9rem 0 8rem;
    background: var(--card-bg-dark);
    color: #fff;
}

.project-hero-inner {
    max-width: 820px;
}

.project-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-decoration: none;
}

.project-back:hover {
    color: var(--accent-green);
}

.project-hero .project-kind {
    background: var(--accent-green);
    color: var(--text-primary);
}

.project-hero h1 {
    margin: 1rem 0;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.1;
    font-weight: 700;
}

.project-lead {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
}

.project-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.visit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    background: var(--accent-green);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
    transition: transform 0.2s ease;
}

.visit-button:hover {
    transform: translateY(-2px);
}

.project-showcase {
    margin-top: -5rem;
}

.browser-window {
    border-radius: 14px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.browser-window .browser-bar {
    height: 40px;
}

.live-frame {
    display: block;
    width: 100%;
    height: min(75vh, 760px);
    min-height: 420px;
    border: 0;
    background: #fff;
}

.browser-window .preview-screen {
    aspect-ratio: 21 / 9;
}

.browser-window .social-screen i,
.browser-window .fallback-screen i {
    font-size: 4rem;
}

.preview-note {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* ---------- Article ---------- */
.project-article {
    max-width: 720px;
    margin: 4.5rem auto 5rem;
    padding: 0 1.5rem;
}

.prose {
    color: #222;
    font-size: 1.1rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

.prose > :first-child { margin-top: 0; }

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: var(--text-primary);
    line-height: 1.25;
    margin: 2.5rem 0 1rem;
}

.prose h1 { font-size: 2.1rem; }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.35rem; }
.prose h4 { font-size: 1.1rem; }

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table {
    margin: 0 0 1.35rem;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
}

.prose li { margin: 0.4rem 0; }

.prose a {
    color: #3b7a00;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover { color: var(--text-primary); }

.prose blockquote {
    padding: 0.75rem 1.25rem;
    border-left: 4px solid var(--accent-green);
    background: #fafafa;
    color: #444;
}

.prose blockquote > :last-child { margin-bottom: 0; }

.prose code {
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: #f1f1f1;
    font-size: 0.88em;
}

.prose pre {
    padding: 1.25rem;
    border-radius: 10px;
    background: #111;
    color: #eee;
    overflow-x: auto;
    line-height: 1.5;
}

.prose pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 10px;
}

.prose hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 1px solid #e5e5e5;
}

.prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.prose th {
    background: #f7f7f7;
    font-weight: 600;
}

.project-footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto 5rem;
    padding: 2rem 1.5rem 0;
    border-top: 1px solid #eee;
}

.project-footer-actions .project-back {
    margin: 0;
    color: var(--text-secondary);
}

.project-footer-actions .project-back:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .project-hero {
        padding: 7.5rem 0 6.5rem;
    }

    .project-lead {
        font-size: 1.05rem;
    }

    .project-showcase {
        margin-top: -4rem;
    }

    .live-frame {
        height: 65vh;
        min-height: 360px;
    }

    .browser-window .preview-screen {
        aspect-ratio: 16 / 10;
    }

    .project-article {
        margin-top: 3rem;
    }

    .prose {
        font-size: 1.02rem;
    }
}
