:root {
    --font-family: "Inter", sans-serif;
    --font-weight-semi-bold: 600;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --primary-color: #171717;
    --secondary-color: #444444;
    --text-primary: #171717;
    --text-secondary: rgba(23, 23, 23, 0.62);
    --background-color: #fcfcfc;
    --logo-bg: #1a1a1a;
    --logo-text: #fafafa;
    --link-opacity: 0.25;
}

:root[data-theme="dark"] {
    --primary-color: #f5f5f5;
    --secondary-color: #d4d4d4;
    --text-primary: #f5f5f5;
    --text-secondary: rgba(245, 245, 245, 0.7);
    --background-color: #090909;
    --logo-bg: #fafafa;
    --logo-text: #101010;
    --link-opacity: 0.5;
}

@font-face {
    font-family: "Inter";
    src: url(../fonts/Inter-SemiBold.woff2) format("woff2");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Inter";
    src: url(../fonts/Inter-Light.woff2) format("woff2");
    font-weight: 300;
    font-style: normal;
}

body {
    font-family: var(--font-family);
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: var(--font-weight-regular);
    color: var(--primary-color);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

body a {
    color: var(--text-primary);
}

h1,
h2,
h3,
h4 {
    padding-top: 1rem;
    font-family: var(--font-family);
    font-weight: var(--font-weight-semi-bold);
}

main {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-bottom: 3.075em;
    margin-inline: auto;
    width: min(100%, 32.5em);
}

p {
    line-height: 1.6;
}

.header {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-bottom: 3.075em;
    margin-inline: auto;
    width: min(100%, 32.5em);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-mark {
    background: var(--logo-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "Inter", sans-serif;
    padding: 8px 8px;
    border-radius: 0;
    transition: background-color 0.3s ease;
}

.logo-line {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--logo-text);
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.logo-line:first-child {
    margin-bottom: 1px;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
    font-family: "Inter", sans-serif;
    transition: all 0.3s ease;
    position: relative;
}

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

.nav a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

.nav__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-inline: auto;
    width: min(100%, 32.5em);
}

footer {
    display: flex;
    flex-direction: column;
    margin-bottom: 3.55em;
    margin-inline: auto;
    width: min(100%, 32.5em);
}

.footer__link {
    text-decoration: none;
    font-family: var(--font-family);
    font-weight: var(--font-weight-semi-bold);
    font-size: 1rem;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.3s ease;
}

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

.footer__link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.footer__link:hover::after {
    width: 100%;
}

time {
    display: block;
    font-size: 0.8rem;
    padding: 1rem;
    padding-left: 0;
}

ul {
    list-style: disc;
}

li {
    padding: 1rem;
}

li::marker {
    color: var(--secondary-color);
}

.img-logo {
    width: 44px;
    text-decoration: none;
}

span.date {
    display: none;
}

span.author {
    display: none;
}

clickable-area {
    display: block;
}

/* Accessibility Improvements */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--secondary-color); /* Focus outline for keyboard navigation */
}

/* Code formatting */
pre {
    white-space: pre-line;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 1rem 0 2rem 0;
    width: 100%;
}

.photo-gallery.preview {
    grid-template-columns: repeat(3, 1fr);
    max-height: 200px;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
}

.photo-gallery.preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--background-color));
    pointer-events: none;
}

.photo-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-gallery.preview .photo-gallery-item {
    cursor: pointer;
}

.photo-gallery.preview .photo-gallery-item:hover {
    transform: none;
    box-shadow: none;
}

clickable-area .photo-gallery-item {
    cursor: default;
    pointer-events: none;
}

clickable-area .photo-gallery-item:hover {
    transform: none;
    box-shadow: none;
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    line-height: 1;
    transition: background 0.2s ease;
    border-radius: 4px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 1rem;
}

.lightbox-nav.next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.35rem;
    }

    .lightbox-nav {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    .lightbox-close {
        font-size: 1.5rem;
    }
}
