@import './vars.css';

body {
    font-family: var(--font);
    margin: 0;
    background-color: #F5F5F5;
    color: var(--color-text);
}

header {
    text-align: center;
    padding: 50px;
    background-color: var(--color-bg-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    margin: 0;
    font-size: 2.5em;
}

h2 {
    text-align: center;
    margin-top: 10px;
    font-size: 1.5em;
    font-weight: 300;
    color: var(--color-primary);
}

h3 {
    text-align: left;
    margin-top: 10px;
    font-size: 1.3em;
    font-weight: 300;
}

h4 {
    text-align: left;
    margin-top: 10px;
    font-size: 1.3em;
    font-weight: 300;
}

section {
    padding: 50px 20px;
    text-align: center;
}

.blog-post {
    background-color: var(--color-bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 30px auto;
    max-width: 800px;
    border-radius: 10px;
    padding: 40px;
}

.blog-post h2 {
    color: var(--color-text);
    margin-top: 0;
}

.blog-post h3 {
    color: var(--color-text);
    margin-top: 30px;
    margin-bottom: 15px;
}

.blog-post h4 {
    color: var(--color-text);
    margin-top: 30px;
    margin-bottom: 15px;
}

.blog-post p {
    text-indent:50px;
    text-align: justify;
    color: var(--color-text-mid);
}

.blog-post a {
    color: var(--color-primary);
    text-decoration: underline;
}

.blog-post ul {
    text-align: left;
    color: var(--color-text-mid);
}

.blog-post blockquote {
    border-left: 4px solid var(--color-primary);
    text-align: left;
    margin: 20px 0;
    padding-left: 20px;
    color: var(--color-primary);
}

.blog-post .date {
    text-indent:0px;
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

.blog-post .img-caption {
    text-indent: 0px;
    color: var(--color-text-light);
    margin-top: 3px;
    font-size: 0.98em;
    text-align: center;
}

.blog-post .mini-note {
    font-size: 0.8em;
    text-align: left;
    text-indent: 0px;
    color: var(--color-text-light);
    margin-top: 3px;
}

.blog-post img {
    width: 80%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.07);
}

.blog-post .img30 {
    width: 30%;
}

.blog-post .img50 {
    width: 50%;
}

.blog-post .img70 {
    width: 70%;
}

.blog-post .img100 {
    width: 100%;
}

.mobile-cap {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.tg  {
    border-collapse:collapse;
    border-spacing:0;
    margin-left: auto;
    margin-right: auto;
}

.tg td{
    color: var(--color-text-mid);
    border-color: var(--color-text-mid);
    border-style:solid;
    border-width:1px;
    font-size:1em;
    overflow:hidden;
    padding:10px 5px;
    word-break:normal;
}

.tg th{
    color: var(--color-text-mid);
    border-color: var(--color-text-mid);
    border-style:solid;
    border-width:1px;
    font-size:1em;
    font-weight:normal;
    overflow:hidden;
    padding:10px 5px;
    word-break:normal;
}

.tg .tg-baqh{
    text-align:center;
    vertical-align:middle
}

.tg .tg-amwm{
    font-weight:bold;
    text-align:center;
    vertical-align:top
}

.tg .tg-amwmr{
    font-weight:bold;
    text-align:right;
    vertical-align:top
}

/* Basic styling for the pre and code elements */
pre code {
    display: block;
    white-space: pre;
    font-family: monospace;
    white-space: pre-wrap;
    text-align: left;
}

/* Specific styling for the code block container */
pre {
    background-color: var(--color-text-stronger);
    color: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gallery-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    background-color: var(--color-bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
}

.gallery-container h3 {
    color: var(--color-text);
    margin-top: 0;
}

.gallery-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 480px;
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gallery-prev {
    left: 12px;
}

.gallery-next {
    right: 12px;
}

.gallery-prev:hover,
.gallery-next:hover {
    background-color: rgba(106, 13, 173, 0.75);
    transform: translateY(-50%) scale(1.08);
}

.gallery-prev:active,
.gallery-next:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-counter {
    position: absolute;
    top: 10px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 10;
}

.gallery-expand {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    z-index: 10;
}

.gallery-expand:hover {
    background-color: rgba(106, 13, 173, 0.75);
    transform: scale(1.08);
}

.gallery-caption,
.blog-post .gallery-caption {
    color: var(--color-text-light);
    margin-top: 18px;
    font-size: 0.98em;
    text-align: center;
    text-indent: 0;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(5, 0, 10, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1000;
    padding: 20px;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

body.lightbox-locked {
    overflow: hidden;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-caption {
    color: rgba(255,255,255,0.85);
    font-size: 0.9em;
    margin-top: 16px;
    text-align: center;
    text-indent: 0;
    max-width: 640px;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2em;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s, color 0.15s;
}

.lightbox-close:hover {
    color: var(--color-accent-purple);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(106, 13, 173, 0.75);
    transform: translateY(-50%) scale(1.08);
}

.back-button {
    margin-left: 20px;
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

/* General Mobile Styles */
@media (max-width: 768px) {
    body {
        font-size: 1.0em;
    }

    header {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2, h3, h4 {
        font-size: 1.2em;
    }

    .blog-post {
        padding: 20px;
        margin: 20px;
    }

    .blog-post p {
        text-indent: 25px;
        font-size: 1.0em;
        text-align: justify;
    }

    .blog-post img {
        width: 100%;
        height: auto;
    }

    .blog-post .img30 {
        width: 100%;
    }

    .blog-post .img50 {
        width: 100%;
    }

    .blog-post .img70 {
        width: 100%;
    }

    .tg {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin: 20px 0;
    }

    .tg td,
    .tg th {
        font-size: 0.80em;
        padding: 8px 4px;
        white-space: normal;
    }

    .gallery-container {
        max-width: 92%;
        padding: 16px;
    }

    .gallery-viewport {
        aspect-ratio: 4 / 3;
        max-height: 320px;
    }

    .gallery-prev,
    .gallery-next {
        width: 34px;
        height: 34px;
        font-size: 1.1em;
    }

    .gallery-expand {
        width: 28px;
        height: 28px;
        font-size: 0.9em;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-close {
        top: 10px;
        right: 14px;
        font-size: 1.8em;
    }

    .blog-post img.mobile-cap {
        width: 50% !important;
    }

    .back-button {
        margin: 10px auto;
        display: block;
        text-align: center;
    }
}
