:root {
  --bg: #f0f7f4;
  --paper: #fbfffd;
  --ink: #1b3329;
  --muted: #52796f;
  --accent: #2d6a4f;
  --accent-soft: #74c69d;
  --accent-dark: #1b4332;
  --line: #d8e9e2;
  --shadow: 0 8px 28px rgba(27, 67, 50, 0.1);
  --radius: 14px;
  --radius-card: 22px;
  --font: "Open Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
.przepisy-page {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #e8f3ed 0%, var(--bg) 180px);
  line-height: 1.5;
  border-radius: 12px;
  overflow: hidden;
}

.hero {
  background: #ffffff;
  color: #263a32;
  padding: 2.25rem 1.25rem 1.75rem;
  border-bottom: 1px solid #d8e9e2;
}
.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}
.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: #52796f;
}
.hero h1 {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: #173e2f !important;
}
.subtitle {
  margin: 0.6rem 0 1.4rem;
  color: #536b61;
  font-size: 1rem;
  font-weight: 600;
}

.cat-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.cat-btn {
  border: 1px solid #c8ddd4;
  background: #f3f8f5;
  color: #263a32;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.88rem;
  transition: background 0.15s, transform 0.15s;
}
.cat-btn:hover, .cat-btn.active {
  background: #dcefe5;
  border-color: #74a98f;
  transform: translateY(-1px);
}
.cat-btn .count {
  opacity: 0.75;
  font-size: 0.8em;
  margin-left: 0.25rem;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.section { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.section h2 {
  font-family: var(--font);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border: none;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(27, 67, 50, 0.14);
}
.card-thumb {
  aspect-ratio: 4 / 3;
  background: #e8f3ed;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
}
.card-thumb .placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--muted);
}
.card-title {
  padding: 0.9rem 1rem 1.05rem;
  flex: 1;
}
.card-title-main {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.card-title-sub {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 40, 30, 0.55);
}
.modal-panel {
  position: relative;
  z-index: 1;
  background: var(--paper);
  width: min(960px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 0.5rem 0.5rem 0 0;
  border: none;
  background: var(--accent);
  color: white;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.modal-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 0;
  align-items: stretch;
}
@media (max-width: 720px) {
  .modal-grid { grid-template-columns: 1fr; }
}
.modal-figure {
  margin: 0;
  background: #e8f3ed;
  overflow: hidden;
  display: flex;
  align-self: stretch;
  min-height: 240px;
}
.modal-figure img {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  object-fit: cover;
  object-position: center;
  display: block;
}
@media (max-width: 720px) {
  .modal-figure {
    min-height: 220px;
    max-height: 42vh;
  }
}
.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.modal-cat {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}
#modalText {
  font-family: var(--font);
  font-size: 0.88rem;
  line-height: 1.55;
  background: #f4faf7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 0;
  overflow-x: auto;
}
.recipe-content h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.recipe-content h5 {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.recipe-content h4 {
  margin: 1.35rem 0 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.35rem;
}
.recipe-content h4:first-child {
  margin-top: 0;
}
.recipe-content .recipe-meta {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.recipe-content ul.recipe-list {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}
.recipe-content ul.recipe-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.18rem 0;
  border-bottom: 1px dotted rgba(82, 121, 111, 0.15);
}
.recipe-content ul.recipe-list li:last-child {
  border-bottom: none;
}
.recipe-content .ing-name {
  flex: 1;
  min-width: 0;
}
.recipe-content .ing-qty {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.recipe-content p,
.recipe-content .recipe-instructions {
  margin: 0 0 0.85rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.65;
}
.recipe-content h4 + .recipe-instructions,
.recipe-content h4 + p {
  margin-top: 0.1rem;
}
.recipe-content .recipe-instructions {
  font-size: 0.88rem;
}
.recipe-content p:last-child,
.recipe-content .recipe-instructions:last-child {
  margin-bottom: 0;
}
.modal-source {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.modal-source a { color: var(--accent); }

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer a {
  color: var(--muted);
  margin-left: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer a:hover {
  color: var(--accent);
}
