/* ========================
   Global Variables & Reset
========================= */
:root {
  --bgcolor: #FAFAFA;
  --fontcolor: #1A1A1A;
  --linkcolor: #C71712;
  --visitedcolor: #C71712;
  --precolor: #111111;
  --prebgcolor: #F5F5F5;
}

html {
  overflow-y: scroll;
}

/* ========================
   Dark-mode
========================= */
[data-theme="dark"] {
  --bgcolor: #121212;
  --fontcolor: #E0E0E0;
  --linkcolor: #38ED9A;
  --visitedcolor: #38ED9A;
  --precolor: #F5F5F5;
  --prebgcolor: #111111;
}

[data-theme="dark"] figcaption,
[data-theme="dark"] .meta {
  color: var(--fontcolor);
}

#theme-toggle {
  position: absolute;
  top: 0px;
  right: 0px;
  background: none;
  border: 1px solid transparent !important;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--linkcolor);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle:hover {
  border: 1px solid var(--linkcolor) !important;
}

#theme-icon {
  margin: 0;
  padding: 0;
}

/* ========================
   Fonts
========================= */
@font-face {
  font-family: 'Kurier-Regular';
  src: url('../fonts/Kurier-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Antykwa-Poltawski';
  src: url('../fonts/antpol-regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ========================
   Typography & Layout
========================= */
body {
  font-family: 'Kurier-Regular';
  max-width: 720px;
  margin: 48px auto;
  padding: 0 10px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fontcolor);
  background: var(--bgcolor);
  text-align: justify;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphenate-limit-chars: 6 3 2;
  lang: pl;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
  text-align: left;
}

.language-switcher {
  text-align: right;
}

.language-switcher .disabled {
  color: #999;
  cursor: not-allowed;
}

.site-title {
  color: var(--subtitlecolor);
  margin-bottom: 0.1em;
  text-align: center;
}

.site-subtitle {
  color: var(--subtitlecolor);
  margin-top: 0.1em;
  text-align: center;
}

.emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

/* ========================
   Links
========================= */
a:link {
  color: var(--linkcolor);
  text-decoration: none;
}
a:visited,
a:active {
  color: var(--visitedcolor);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ========================
   Headings
========================= */
h1, h2, h3 h4 {
  margin: 1em 0;
  text-align: left;
}

/* ========================
   Text & Code Blocks
========================= */
code,
p > code {
  color: var(--precolor);
  background: var(--prebgcolor);
  padding: 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
pre {
  color: var(--precolor);
  background: var(--prebgcolor);
  padding: 24px;
  overflow-x: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

i[class^="fa-"],
i[class*=" fa-"] {
  font-size: 1em;
}

/* ========================
   Lists
========================= */
li {
  text-align: left;
}
.post-list,
.post-item {
  list-style: none;
  text-align: left;
  margin: 0;
  padding: 0;
}

.footnotes ol {
  margin: 0;
  padding-left: 1.2em;
}

.footnotes li {
  margin-bottom: 0;
  padding: 0;
}

.footnotes li p {
  margin: 0;
  padding: 0;
}

/* ========================
   Article Styling
========================= */
article {
  text-align: justify;
  margin: 0;
  padding: 0;
}

/* ========================
   Post Navigation
========================= */

.post-navi {
  display: flex;
  justify-content: space-between;
  margin: 1em 0;
}

.post-navi a {
  text-decoration: none;
}

.post-navi a:hover {
  text-decoration: underline;
}

.post-navi .disabled {
  color: #999;
  cursor: not-allowed;
}

/* ========================
   Images & Media
========================= */
img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}

.image-item {
  margin-bottom: 1em;
}

.center {
  display: block;
  margin: 0 auto;
  width: 100%;
}

.image-wrapper {
  position: relative;
  max-width: 100%;
  padding-bottom: 66.6667%;
  overflow: hidden;
  border: 1px solid transparent;
}

.image-wrapper:hover {
  border: 1px solid var(--linkcolor);
}

.image-wrapper img {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
}

.footer-banner {
  width: 88px !important;
  height: 31px !important;
  max-width: none !important;
  display: inline-block !important;
  border: 1px solid transparent;
  margin: 0 !important;
  object-fit: contain !important;
}

.footer-banner:hover {
  border: 1px solid var(--linkcolor);
}

/* ========================
   Figures & Captions
========================= */
figure {
  margin: auto;
}
figcaption {
  color: var(--fontcolor);
  font-size: 0.9em;
  margin-top: 0.5em;
  text-align: left;
}

/* ========================
   Meta Information
========================= */
.meta {
  display: inline;
  margin-right: 10px;
  min-width: 100px;
  color: #999;
  font-size: 14px;
}

/* ========================
   Image Gallery
========================= */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.image-gallery figure {
  margin: 0;
}
.image-gallery .image-wrapper {
  width: 100%;
  position: relative;
  padding-bottom: 100%;
  overflow: hidden;
  cursor: pointer;
}
.image-gallery .image-wrapper img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* ========================
   Lightbox: Global + Gallery
========================= */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: default;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  cursor: zoom-in;
  user-select: none;
  border: 1px solid transparent;
}

.lightbox-img:hover {
  border: 1px solid var(--linkcolor);
}

.lightbox-img.zoomed {
  cursor: zoom-out;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-size: 1.2rem;
  z-index: 1003;
}

/* Navigation */
.lightbox-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  pointer-events: none;
}
.lightbox-nav button {
  pointer-events: all;
}
.lightbox-nav.left {
  left: 10px;
}
.lightbox-nav.right {
  right: 10px;
}
.nav-btn {
  background: rgba(0, 0, 0, 0);
  border: none;
  width: 40px;
  height: 40px;
  font-size: 2em;
  font-weight: bold;
  color: white;
  cursor: pointer;
  user-select: none;
}
.nav-btn:hover {
  background: rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ========================
   Embedded Video
========================= */
figure.video-item {
  margin-bottom: 1em;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 66.6667%;
  height: 0;
  overflow: hidden;
  margin-bottom: 0.5em;
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
