/*
Theme Name: Dziennik Melanii Dorsz
Theme URI: https://example.com/meladorsz
Author: OpenCode
Author URI: https://example.com
Description: Pamiętnik blogowy Melanii Dorsz — przytulny motyw w pastelowej kolorystyce.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
Text Domain: meladorsz
*/

/* ── Variables ──────────────────────────────────────── */

:root {
  --bg:        #eef3f7;
  --panel:     #dde7ef;
  --ink:       #1e2a3f;
  --muted:     #4a5a7a;
  --line:      #c8d5e0;
  --accent-1:  #e88fa8;
  --accent-2:  #e8c352;
  --accent-3:  #7ab2d4;
  --accent-4:  #9fa8d6;
  --accent-5:  #a8c7b6;
  --card:      #ffffff;
  --footer-bg: #1e2a3f;
  --shadow:    rgba(30, 42, 63, 0.12);
}

/* ── Reset ──────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Layout ─────────────────────────────────────────── */

.site-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Banner ─────────────────────────────────────────── */

.site-banner {
  background: var(--panel);
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  padding: 28px 24px 24px;
  text-align: center;
  margin-bottom: 0;
}

.site-banner .site-title {
  display: inline-block;
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}

.site-banner .site-title a {
  color: inherit;
}

/* ── Navigation ─────────────────────────────────────── */

.primary-nav {
  background: var(--panel);
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  padding: 0 24px 16px;
  text-align: center;
  margin-bottom: 32px;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-nav li {
  display: inline-block;
}

.primary-nav a {
  display: inline-block;
  padding: 7px 18px 8px;
  border-radius: 999px;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: transparent;
  border: 2px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  background: rgba(30, 42, 63, 0.08);
  outline: none;
}

.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-ancestor > a,
.primary-nav .current-page-ancestor > a {
  background: var(--accent-1);
  color: #fff;
  box-shadow: 0 3px 0 rgba(232, 143, 168, 0.4);
}

/* ── Page content anchor ────────────────────────────── */

#site-content {
  outline: none;
}

/* ── Section title ──────────────────────────────────── */

.section-title {
  margin: 0 0 24px;
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
  text-align: center;
}

/* ── Post grid ──────────────────────────────────────── */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}

/* ── Card (pillow style) ────────────────────────────── */

.card {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 10px 0 -4px rgba(30, 42, 63, 0.07),
    0 14px 28px -10px rgba(30, 42, 63, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 14px 0 -4px rgba(30, 42, 63, 0.09),
    0 22px 38px -10px rgba(30, 42, 63, 0.22);
  outline: none;
}

/* Thumbnail */

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.card-thumb-fallback {
  width: 100%;
  aspect-ratio: 16 / 10;
  flex-shrink: 0;
}

.card:nth-child(3n+1) .card-thumb-fallback {
  background: repeating-linear-gradient(
    45deg,
    rgba(232, 143, 168, 0.35) 0,
    rgba(232, 143, 168, 0.35) 4px,
    var(--panel) 4px,
    var(--panel) 20px
  );
}

.card:nth-child(3n+2) .card-thumb-fallback {
  background: repeating-linear-gradient(
    -35deg,
    rgba(122, 178, 212, 0.45) 0,
    rgba(122, 178, 212, 0.45) 4px,
    var(--panel) 4px,
    var(--panel) 20px
  );
}

.card:nth-child(3n) .card-thumb-fallback {
  background: repeating-linear-gradient(
    90deg,
    rgba(232, 195, 82, 0.4) 0,
    rgba(232, 195, 82, 0.4) 4px,
    var(--panel) 4px,
    var(--panel) 20px
  );
}

/* Card body */

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.card-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.card-title {
  margin: 0 0 8px;
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

.card-excerpt {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 8px 18px 9px;
  border-radius: 999px;
  background: var(--accent-1);
  color: #fff;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(232, 143, 168, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(232, 143, 168, 0.45);
}

.card:nth-child(3n+2) .card-btn {
  background: var(--accent-3);
  box-shadow: 0 3px 0 rgba(122, 178, 212, 0.45);
}

.card:nth-child(3n+2) .card-btn:hover {
  box-shadow: 0 5px 0 rgba(122, 178, 212, 0.45);
}

.card:nth-child(3n) .card-btn {
  background: var(--accent-4);
  box-shadow: 0 3px 0 rgba(159, 168, 214, 0.45);
}

.card:nth-child(3n) .card-btn:hover {
  box-shadow: 0 5px 0 rgba(159, 168, 214, 0.45);
}

/* ── More stories link ──────────────────────────────── */

.more-stories-wrap {
  text-align: center;
  margin: 28px 0 8px;
}

.more-stories-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 26px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 0 rgba(30, 42, 63, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.more-stories-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(30, 42, 63, 0.3);
}

/* ── Empty state ────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ── Pagination ─────────────────────────────────────── */

.pagination {
  text-align: center;
  padding: 32px 0 8px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  margin: 0 3px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pagination .page-numbers:hover {
  border-color: var(--accent-3);
  color: var(--ink);
}

.pagination .page-numbers.current {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
}

.pagination .page-numbers.dots {
  border: none;
  background: none;
}

/* ── Single post ────────────────────────────────────── */

.single-article {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(30, 42, 63, 0.1);
  margin-bottom: 32px;
}

.single-thumb {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
}

.single-thumb-fallback {
  width: 100%;
  aspect-ratio: 16 / 7;
  background: repeating-linear-gradient(
    45deg,
    rgba(232, 143, 168, 0.3) 0,
    rgba(232, 143, 168, 0.3) 6px,
    var(--panel) 6px,
    var(--panel) 28px
  );
}

.single-body {
  padding: 28px 32px 32px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.single-cat {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.single-date,
.single-author {
  font-size: 0.82rem;
  color: var(--muted);
}

.single-body h1 {
  margin: 0 0 20px;
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
}

.single-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}

.single-content p {
  margin: 0 0 1.2em;
}

.single-content h2,
.single-content h3,
.single-content h4 {
  font-family: "Caprasimo", "Georgia", serif;
  font-weight: 400;
  line-height: 1.2;
  margin: 1.6em 0 0.5em;
  color: var(--ink);
}

.single-back {
  display: flex;
  justify-content: flex-start;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(30, 42, 63, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(30, 42, 63, 0.35);
}

/* ── Comments ───────────────────────────────────────── */

.comments-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 2px solid var(--line);
}

.comments-title,
.comment-reply-title {
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 20px;
}

.comment-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.comment-list li {
  margin-bottom: 10px;
}

.comment-body {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px 18px;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar {
  border-radius: 50%;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: cover;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

.comment-author-name a {
  color: var(--ink);
}

.comment-date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.comment-text p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  font-size: 0.93rem;
}

.comment-actions {
  margin-top: 8px;
  text-align: right;
}

.comment-reply-link {
  font-size: 0.8rem;
  color: var(--accent-3);
  font-weight: 700;
}

.comment-reply-link:hover {
  text-decoration: underline;
}

.comment-list .children {
  list-style: none;
  padding-left: 26px;
  margin-top: 8px;
}

/* Comment form */

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.comment-form-field label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--muted);
}

.comment-form-field input[type="text"],
.comment-form-field input[type="email"],
.comment-form-field textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--card);
  transition: border-color 0.15s ease;
  width: 100%;
}

.comment-form-field input:focus,
.comment-form-field textarea:focus {
  outline: none;
  border-color: var(--accent-3);
}

.comment-form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-comment-submit {
  align-self: flex-start;
  padding: 10px 26px;
  background: var(--accent-3);
  color: #fff;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(122, 178, 212, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-comment-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(122, 178, 212, 0.45);
}

.logged-in-as {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

.logged-in-as a {
  color: var(--accent-3);
}

/* ── Archive page intro ──────────────────────────────── */

.archive-intro {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 28px;
  text-align: center;
}

/* ── Generic page ───────────────────────────────────── */

.page-article {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 32px 32px;
  box-shadow: 0 6px 24px rgba(30, 42, 63, 0.1);
  margin-bottom: 32px;
}

.page-article h1 {
  margin: 0 0 16px;
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
}

.page-content {
  font-size: 1.03rem;
  line-height: 1.7;
  color: var(--ink);
}

.page-content p {
  margin: 0 0 1.2em;
}

/* ── Main wrapper ───────────────────────────────────── */

.site-main {
  padding: 32px 0 40px;
}

/* ── Footer ─────────────────────────────────────────── */

.site-footer {
  position: relative;
  background: var(--footer-bg);
  color: #cfe0ef;
  text-align: center;
  padding: 40px 24px 28px;
  margin-top: 48px;
  border-radius: 36px 36px 0 0;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -16px;
  left: -1px;
  right: -1px;
  height: 20px;
  background-image: radial-gradient(circle at 10px 20px, var(--footer-bg) 12px, transparent 13px);
  background-size: 20px 20px;
  background-repeat: repeat-x;
  background-position: 0 0;
}

.footer-title {
  font-family: "Caprasimo", "Georgia", serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 400;
  color: #e8f3ff;
  margin: 0 0 14px;
}

.footer-title a {
  color: inherit;
}

.footer-nav ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #a8c8e0;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: #e8f3ff;
}

.footer-copy {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 980px) {
  .site-shell {
    padding: 0 14px;
  }

  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-body {
    padding: 20px 22px 24px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 0 10px;
  }

  .site-banner {
    padding: 20px 16px 18px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .site-main {
    padding: 20px 0 28px;
  }

  .primary-nav a {
    font-size: 0.88rem;
    padding: 6px 14px 7px;
  }

  .single-body {
    padding: 16px 16px 20px;
  }

  .page-article {
    padding: 18px 16px 20px;
  }

  .comment-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .comment-list .children {
    padding-left: 14px;
  }
}
