:root {
  --rd-green-dark: #2e4e2a;
  --rd-green: #41663c;
  --rd-accent: #5a8139;
  --rd-cream: #f4f6f1;
  --rd-text: #223020;
  --rd-white: #fff;
}

.rd-postcards { width: 100%; max-width: none; font-family: inherit; color: var(--rd-text); }
.rd-postcards *, .rd-postcards *::before, .rd-postcards *::after { box-sizing: border-box; }
.rd-anchor-section { scroll-margin-top: 110px; }
.rd-postcards__form-section { width: 100%; }
.rd-postcards__intro { text-align: center; max-width: 760px; margin: 0 auto 34px; }
.rd-postcards__eyebrow { display: block; color: var(--rd-accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; margin-bottom: 8px; }
.rd-postcards__intro h2 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; color: var(--rd-green-dark); }
.rd-postcards__intro p { margin: 0; font-size: 17px; color: #5f6c5b; }

.rd-postcard-form { width: 100%; max-width: none; margin: 0 0 80px; background: var(--rd-white); padding: clamp(22px, 4vw, 48px); box-shadow: 0 18px 55px rgba(31, 60, 28, .13); border-top: 5px solid var(--rd-accent); }
.rd-postcard-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.rd-field { margin-bottom: 24px; border: 0; padding: 0; min-width: 0; }
.rd-field label, .rd-field legend { display: block; font-weight: 800; margin-bottom: 9px; color: var(--rd-green-dark); }
.rd-field label span, .rd-field legend span, .rd-consent b { color: var(--rd-accent); }
.rd-field input[type="text"], .rd-field textarea { width: 100%; border: 1px solid #d6dfd2; background: #f8faf7; color: var(--rd-text); padding: 15px 16px; border-radius: 0; font: inherit; outline: none; transition: .2s ease; }
.rd-field input[type="text"]:focus, .rd-field textarea:focus { border-color: var(--rd-accent); box-shadow: 0 0 0 3px rgba(90, 129, 57, .14); background: #fff; }

.rd-stars { display: flex; align-items: center; gap: 7px; min-height: 52px; flex-wrap: nowrap; }
.rd-star { appearance: none; border: 0; background: transparent; color: #cbd4c7; padding: 0; font-size: 34px; line-height: 1; cursor: pointer; transition: transform .15s ease, color .15s ease; }
.rd-star:hover { transform: translateY(-2px); }
.rd-star.is-active { color: #f5c542; }
.rd-rating-clear { appearance: none; background: transparent; border: 0; color: #778273; text-decoration: underline; cursor: pointer; margin-left: 6px; white-space: nowrap; }
.rd-rating-value { display: inline-flex; align-items: center; margin-left: 8px; font-weight: 800; color: var(--rd-green-dark); white-space: nowrap; }

.rd-upload-box { position: relative; min-height: 160px; border: 2px dashed #9fb296; background: var(--rd-cream); display: grid; place-items: center; text-align: center; padding: 24px; transition: .2s ease; }
.rd-upload-box:hover { border-color: var(--rd-accent); background: #eef3ea; }
.rd-upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rd-upload-box__content strong { display: block; font-size: 20px; color: var(--rd-green-dark); margin-bottom: 6px; }
.rd-upload-box__content span { color: #697565; }
.rd-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.rd-preview__item { position: relative; aspect-ratio: 1; overflow: hidden; background: #edf1ea; }
.rd-preview__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-preview__remove { position: absolute; top: 7px; right: 7px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(20, 35, 18, .88); color: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.25); transition: .2s ease; }
.rd-preview__remove:hover { background: #a33a32; transform: scale(1.06); }

.rd-consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #5d6859; margin: 0 0 24px; cursor: pointer; }
.rd-consent input { margin-top: 3px; accent-color: var(--rd-accent); }
.rd-submit { border: 0; background: var(--rd-accent); color: #fff; min-width: 250px; padding: 16px 24px; display: inline-flex; justify-content: center; align-items: center; gap: 24px; font-weight: 900; cursor: pointer; transition: .2s ease; }
.rd-submit:hover { background: var(--rd-green-dark); transform: translateY(-1px); }
.rd-submit:disabled { opacity: .65; cursor: wait; }
.rd-form-message { margin-top: 18px; font-weight: 700; }
.rd-form-message.is-success { color: #3e6c31; }
.rd-form-message.is-error { color: #a33a32; }
.rd-honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; pointer-events: none !important; }

.rd-postcards__list-wrap { width: 100vw; background: var(--rd-green-dark); margin-inline: calc(50% - 50vw); padding: 70px max(20px, calc((100vw - 1180px) / 2)); overflow: hidden; }
.rd-postcards__intro--list h2, .rd-postcards__intro--list p { color: #fff; }
.rd-postcards__intro--list .rd-postcards__eyebrow { color: #b8d49d; }
.rd-postcards__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; width: 100%; max-width: 1180px; margin: 0 auto; }

.rd-postcard-card { width: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); background: var(--rd-green); color: #fff; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.18); min-height: 360px; }
.rd-postcard-card--images-0 { grid-template-columns: 1fr; min-height: 0; }
.rd-postcard-card__gallery { min-width: 0; min-height: 360px; display: grid; gap: 4px; background: #263f23; overflow: hidden; }
.rd-postcard-card__gallery--1 { grid-template-columns: 1fr; }
.rd-postcard-card__gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-postcard-card__gallery--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.rd-postcard-card__gallery--3 .rd-postcard-card__image--1 { grid-row: 1 / 3; }
.rd-postcard-card__image { min-width: 0; min-height: 0; overflow: hidden; background: #e8ece5; }
.rd-postcard-card__image img { width: 100%; height: 100%; min-height: 100%; object-fit: cover; object-position: center; display: block; transition: transform .45s ease; }
.rd-postcard-card:hover .rd-postcard-card__image img { transform: scale(1.035); }
.rd-postcard-card__body { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(26px, 4vw, 48px); }
.rd-postcard-card__rating { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.rd-postcard-card__stars { display: inline-flex; align-items: center; gap: 3px; color: rgba(255,255,255,.28); font-size: 22px; line-height: 1; letter-spacing: 0; margin: 0; }
.rd-postcard-card__stars .is-active { color: #f5c542; }
.rd-postcard-card__rating-value { display: inline-block; color: rgba(255,255,255,.82); font-size: 12px; line-height: 1; font-weight: 800; white-space: nowrap; }
.rd-postcard-card__text { line-height: 1.75; font-size: 16px; overflow-wrap: anywhere; }
.rd-postcard-card__text p { margin: 0 0 14px; }
.rd-postcard-card__author { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.18); font-weight: 900; }
.rd-postcards__empty { max-width: 980px; margin: 30px auto; padding: 24px; text-align: center; background: var(--rd-cream); color: #5d6859; }

@media (max-width: 900px) {
  .rd-postcard-card { grid-template-columns: 1fr; min-height: 0; }
  .rd-postcard-card__gallery { min-height: 0; aspect-ratio: 16 / 10; }
  .rd-postcard-card__body { min-height: 260px; }
}

@media (max-width: 680px) {
  .rd-postcard-form__grid { grid-template-columns: 1fr; }
  .rd-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rd-submit { width: 100%; }
  .rd-postcards__list-wrap { padding-top: 54px; padding-bottom: 54px; }
  .rd-postcards__grid { gap: 22px; }
  .rd-postcard-card__gallery { aspect-ratio: 4 / 3; }
  .rd-postcard-card__gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-postcard-card__gallery--3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1.35fr .85fr; }
  .rd-postcard-card__gallery--3 .rd-postcard-card__image--1 { grid-column: 1 / 3; grid-row: 1; }
  .rd-postcard-card__body { min-height: 0; padding: 24px 20px; }
  .rd-postcard-card__author { margin-top: 10px; }
  .rd-stars { gap: 4px; flex-wrap: wrap; }
  .rd-star { font-size: 30px; }
}

/* 1.4.0: równe karty, zdjęcia opcjonalne i lightbox */
.rd-optional { font-weight: 500; color: #73806f; }
.rd-postcard-card { height: 420px; min-height: 420px; }
.rd-postcard-card--images-0 { height: 320px; min-height: 320px; }
.rd-postcard-card__gallery { height: 420px; min-height: 420px; }
.rd-postcard-card__body { height: 100%; overflow: hidden; }
.rd-postcard-card__text { max-height: 230px; overflow: auto; padding-right: 8px; scrollbar-width: thin; }
.rd-postcard-card__image { position: relative; appearance: none; border: 0; padding: 0; cursor: zoom-in; width: 100%; height: 100%; }
.rd-image-zoom { position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(20,35,18,.78); color: #fff; font-size: 25px; line-height: 1; opacity: 0; transform: translateY(5px); transition: .2s ease; }
.rd-postcard-card__image:hover .rd-image-zoom,
.rd-postcard-card__image:focus-visible .rd-image-zoom { opacity: 1; transform: translateY(0); }
.rd-lightbox { position: fixed; inset: 0; z-index: 999999; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(7,15,7,.94); }
.rd-lightbox.is-open { display: flex; }
.rd-lightbox__image { display: block; max-width: min(1400px, 94vw); max-height: 90vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 18px 70px rgba(0,0,0,.5); }
.rd-lightbox__close { position: fixed; top: 18px; right: 18px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 34px; cursor: pointer; display: grid; place-items: center; }
body.rd-lightbox-open { overflow: hidden; }

@media (max-width: 900px) {
  .rd-postcard-card,
  .rd-postcard-card--images-0 { height: auto; min-height: 0; }
  .rd-postcard-card__gallery { height: auto; min-height: 0; aspect-ratio: 16 / 10; }
  .rd-postcard-card__body { height: auto; overflow: visible; }
  .rd-postcard-card__text { max-height: none; overflow: visible; padding-right: 0; }
}

/* 1.7.0: doładowywanie kolejnych pocztówek */
.rd-postcards__load-more-wrap { width: 100%; max-width: 1180px; margin: 34px auto 0; text-align: center; }
.rd-postcards__load-more { appearance: none; border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff; min-width: 220px; padding: 15px 24px; font-weight: 900; letter-spacing: .04em; cursor: pointer; transition: .2s ease; }
.rd-postcards__load-more:hover { background: #fff; color: var(--rd-green-dark); }
.rd-postcards__load-more:disabled { opacity: .65; cursor: wait; }
.rd-postcards__load-more-message { min-height: 22px; margin-top: 12px; color: #ffd7d3; font-weight: 700; }
