/* adminlog.pl — styles derived from pnapierala.pl/style.css (same palette and components). */

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:        #0d1117;
    --bg-card:   #161b22;
    --bg-alt:    #111318;
    --border:    #21262d;
    --accent:    #58a6ff;
    --accent-2:  #1f6feb;
    --text:      #e6edf3;
    --text-muted:#8b949e;
    --radius:    10px;
    --max-w:     1100px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
}

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    display: block;
    height: 40px;
    width: 40px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ========== ACCENT COLOR ========== */
.accent {
    color: var(--accent);
}

/* Terminal-style prompt line, same as the greeting on pnapierala.pl */
.hero-greeting {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}


/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-2);
    color: #fff;
    border: 1px solid var(--accent-2);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #0d1117;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

/* ========== SECTIONS ========== */
.section {
    padding: 5rem 2rem;
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-sub {
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1rem;
}

/* ========== TAGS ========== */
.tag {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.25);
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-sm {
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
}

/* ========== FOOTER ========== */
#footer {
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

#footer a {
    color: var(--text-muted);
}

#footer a:hover {
    color: var(--text);
}

/* ========== MOBILE MENU ========== */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

.navbar.open .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar.open .nav-hamburger span:nth-child(2) {
    opacity: 0;
}
.navbar.open .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1.25rem;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(13, 17, 23, 0.97);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 1.25rem;
        gap: 0;
    }

    .navbar.open .nav-links {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.85rem 0;
        font-size: 1rem;
        border-bottom: none;
    }

    .section {
        padding: 3.5rem 1.25rem;
    }
}

@media (max-width: 600px) {
    .post-content h1 {
        font-size: 1.5rem;
    }

    .post-content pre {
        padding: 0.85rem;
        font-size: 0.8rem;
    }

    .code-block .copy-btn {
        top: 0.4rem;
        right: 0.4rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ========== BLOG ========== */
body.blog-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

body.blog-page .blog-main {
    flex: 1 0 auto;
    min-width: 0;
}

body.blog-page #footer {
    flex-shrink: 0;
}

.blog-back-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.blog-main {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
    border-color: var(--accent-2);
    transform: translateY(-3px);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.post-title a {
    color: var(--text);
}

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex: 1;
}

.post-readmore {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Full article typography */
.post-content {
    max-width: 900px;
    margin: 0 auto;
    overflow-x: hidden;
}

.post-content h1 {
    font-size: 2rem;
    margin: 1rem 0 0.5rem;
    overflow-wrap: break-word;
}

.post-content h2 {
    font-size: 1.4rem;
    margin: 2rem 0 0.75rem;
    overflow-wrap: break-word;
}

.post-content h3 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.5rem;
    overflow-wrap: break-word;
}

.post-content p {
    margin: 0 0 1rem;
    overflow-wrap: break-word;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1rem 1.25rem;
}

.post-content li {
    margin-bottom: 0.4rem;
    overflow-wrap: break-word;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 0 0 1rem;
    color: var(--text-muted);
    overflow-wrap: break-word;
}

.post-content .table-wrap {
    overflow-x: auto;
    margin: 0 0 1rem;
}

.post-content table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
    overflow-wrap: break-word;
}

.post-content th {
    background: var(--bg-card);
    font-weight: 600;
}

.post-content tbody tr:nth-child(even) {
    background: var(--bg-alt);
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: var(--radius);
}

.post-content a {
    overflow-wrap: break-word;
}

.post-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

.post-content code {
    font-family: 'Fira Code', monospace;
    background: rgba(88, 166, 255, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85em;
    overflow-wrap: break-word;
}

.post-content pre code {
    background: none;
    padding: 0;
    overflow-wrap: normal;
}

.code-block {
    position: relative;
    margin: 0 0 1rem;
    max-width: 100%;
}

.code-block .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}

.code-block .copy-btn:hover {
    opacity: 1;
    color: var(--text);
    border-color: var(--accent);
}

.code-block .copy-btn.is-copied {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.post-content .post-meta {
    margin-bottom: 1.5rem;
}

.section-more {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* ========== ADMINLOG ========== */
.blog-intro .section-sub {
    margin-bottom: 1.5rem;
}

/* Tags are links here (filter by tag) */
a.tag:hover {
    color: #fff;
    border-color: var(--accent);
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter .tag.is-active {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
}

.tag-count {
    opacity: 0.6;
    margin-left: 0.15rem;
}

.not-found {
    text-align: center;
    padding: 3rem 0;
}

.not-found .hero-greeting {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ========== CAROUSEL (latest posts) ========== */
.carousel {
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 340px;
}

.carousel-media {
    position: relative;
    display: block;
    background: var(--bg-alt);
    overflow: hidden;
}

.carousel-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Blurred copy fills the frame; the sharp image is shown whole on top of it. */
.carousel-backdrop {
    object-fit: cover;
    filter: blur(24px) brightness(0.55);
    transform: scale(1.15);
}

.carousel-image {
    object-fit: contain;
    padding: 0.75rem;
}

.carousel-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--bg-alt), var(--bg-card));
}

.carousel-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.75rem;
}

.carousel-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.carousel-title a {
    color: var(--text);
}

.carousel-title a:hover {
    color: var(--accent);
}

.carousel-excerpt {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 500;
}

.carousel-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex: 1;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.9rem;
}

.carousel-controls[hidden] {
    display: none;
}

.carousel-arrow {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.carousel-arrow:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.carousel-dots {
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 0.65rem;
    height: 0.65rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.carousel-dot.is-active {
    background: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .carousel-slide {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .carousel-media {
        aspect-ratio: 16 / 9;
    }

    .carousel-body {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .carousel-track {
        scroll-behavior: smooth;
    }
}
