/* TRMail — layout inspired by clean enterprise marketing (Oxari-like: airy, blue accent, cards) */
@font-face {
  font-family: "OpenSans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Segoe UI"), local("Arial");
  /* Add /assets/fonts/OpenSans-Variable.woff2 for full local Open Sans */
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1a2433;
  --muted: #5c6b7f;
  --accent: #0a6ede;
  --accent-dark: #084f9f;
  --border: #e1e7f0;
  --shadow: 0 12px 40px rgba(15, 34, 58, 0.08);
  --radius: 14px;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Atrybut [hidden] musi wygrywać z .lightbox/.modal { display: grid } — inaczej zostaje „mgła” i blokada strony */
[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: OpenSans, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0 1.25rem;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lang-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.lang-select {
  min-width: 8rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font: inherit;
}

.logo-link .site-logo {
  display: block;
  max-width: 300px;
  height: auto;
}

.logo-fallback {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: center;
  font-weight: 600;
}

.main-nav a {
  color: var(--text);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover {
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.header-banner img {
  display: block;
  max-width: 600px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-main {
  padding: 2rem 0 3rem;
}

.hero-block {
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.hero-block h1 {
  margin-top: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-actions .share-row {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn.ghost {
  background: transparent;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-grid button {
  border: none;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: var(--shadow);
  background: #0000;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card img.thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card .body {
  padding: 1rem 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card .meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.article-hero {
  margin-bottom: 1.25rem;
}

.article-hero img {
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.prose {
  font-size: 1.05rem;
  color: #222c3a;
}

.prose h2,
.prose h3 {
  margin-top: 1.75rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.tag-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #e7f0ff;
  font-size: 0.85rem;
  color: var(--accent-dark);
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.share-icons {
  align-items: center;
  gap: 0.65rem;
}

.share-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(0 0 0 / 15%);
  transition: transform 98ms ease, box-shadow 98ms ease, filter 98ms ease;
}

.share-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgb(0 0 0 / 18%);
  filter: brightness(1.05);
}

.share-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.share-icon--fb {
  background: #1877f2;
}

.share-icon--x {
  background: #000;
}

.share-icon--mail {
  background: #d32f2f;
}

.share-icon--wa {
  background: #25d366;
}

.share-icon--print {
  background: #f57c00;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0 2rem;
}

.stats {
  color: var(--muted);
  font-size: 0.95rem;
}

.like-wrap {
  display: inline-flex;
  align-items: center;
}

.like-wrap form {
  display: inline;
}

.like-wrap button {
  font-size: 1.25rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.like-wrap button:hover:not(:disabled) {
  transform: scale(1.2);
  color: #e53935;
}

.like-wrap.liked button {
  color: #e53935;
  cursor: default;
}

.like-wrap.liked button:disabled {
  opacity: 1;
}

form.trmail-form {
  max-width: 640px;
  display: grid;
  gap: 0.9rem;
}

form.trmail-form.trmail-form--wide {
  max-width: 100%;
}

form.trmail-form label {
  font-weight: 600;
  display: block;
}

form.trmail-form label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}

form.trmail-form label.checkbox-label input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}

form.trmail-form input,
form.trmail-form textarea,
form.trmail-form select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  margin-top: 0.25rem;
}

form.trmail-form textarea {
  resize: vertical;
  min-height: 100px;
}

form.trmail-form .cf-turnstile {
  margin: 0.5rem 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav {
  margin-top: 0.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.flash-ok {
  background: #e6ffef;
  border: 1px solid #9bd4ae;
}

.flash-err {
  background: #ffecec;
  border: 1px solid #e3a0a0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.85);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.lightbox img {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  border: none;
  background: #fff;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
}

.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 1rem;
  box-sizing: border-box;
  align-items: flex-end;
  justify-content: center;
}

.cookie-banner:not([hidden]) {
  display: flex !important;
}

.cookie-dim {
  position: absolute;
  inset: 0;
  background: rgba(15, 34, 58, 0.38);
}

.cookie-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 9000;
  padding: 1rem;
}

.modal-inner {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.modal-inner.modal-wide {
  max-width: 720px;
}

.author-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-panel .author-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .author-panel .author-header {
    flex-direction: column;
  }
}

.author-panel .prose {
  flex: 1;
  width: 100%;
}

.author-photo {
  width: 140px;
  flex-shrink: 0;
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.admin-table th,
.admin-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--surface);
  font-weight: 600;
}

.admin-table tr:hover td {
  background: var(--surface);
}
