/* ============================================================
   1. MEMORIAL FORM + PREVIEW
   ============================================================ */

.memorial-form,
.preview-section {
    max-width: 650px;
    margin: 30px auto;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.memorial-field {
    margin-bottom: 22px;
}

.memorial-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.memorial-field input,
.memorial-field select,
.memorial-field textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.memorial-field textarea {
    resize: vertical;
}

.memorial-field input:focus,
.memorial-field select:focus,
.memorial-field textarea:focus {
    outline: none;
    border-color: #c9d9ff;
    box-shadow: 0 0 0 2px rgba(180, 205, 255, 0.3);
}

/* Дві дати поруч */
.memorial-field-row--dates {
    display: flex;
    gap: 18px;
}
.memorial-field--half {
    flex: 1;
}

/* Помилки */
.memorial-form-errors {
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    padding: 14px 18px;
    border-radius: 6px;
    color: #b71c1c;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Кнопки форми */
.memorial-actions {
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

.memorial-btn {
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.memorial-btn--primary {
    background: #f8cddc;
    border-color: #f2b4cb;
    color: #73314b;
}
.memorial-btn--primary:hover {
    background: #f6b7d0;
    box-shadow: 0 4px 12px rgba(244, 179, 205, 0.45);
}

.memorial-btn--secondary {
    background: #ffffff;
    border-color: #ddd;
    color: #555;
}
.memorial-btn--secondary:hover {
    border-color: #bbb;
    background: #fafafa;
}


/* ============================================================
   2. POPUP PREVIEW
   ============================================================ */

.memorial-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    padding: 20px;
    z-index: 99999;
}

.memorial-modal-overlay.is-open {
    display: flex;
}

.memorial-modal {
    background: #fff;
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.memorial-modal-inner {
    padding: 26px 28px;
}


/* ============================================================
   3. ARCHIVE GRID (FULL PAGE /memorials/)
   ============================================================ */

/* Сітка архіву */
.pet-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

/* Картка на архіві – ТАКА Ж, ЯК НА ГОЛОВНІЙ */
.pet-gallery-item {
    background: #ffffff !important;
    border: 1px solid #efe8e2 !important;
    border-radius: 18px !important;
    overflow: hidden;
    padding: 18px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pet-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08) !important;
}

/* Фото на архівній картці */
.pet-gallery-img {
    width: 100%;
    height: 260px;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 10px;
    background: #faf6f4;
}

.pet-gallery-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 14px;
}

/* Текст на архівних картках */
.pet-gallery-title {
    margin: 4px 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #444;
    text-align: center;
}

.pet-gallery-meta {
    margin-top: 4px;
    font-size: 14px;
    color: #777;
    text-align: center;
}


/* ============================================================
   4. HOMEPAGE GRID (4 LAST CARDS) – [memorials_list]
   ============================================================ */

/* Контейнер блоку на головній */
.pet-memorial-wrapper {
    margin: 40px 0 20px;
    padding-bottom: 40px;
}

/* Сітка карток на головній */
.pet-memorial-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
}

@media (max-width: 1024px) {
    .pet-memorial-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 600px) {
    .pet-memorial-list {
        grid-template-columns: 1fr !important;
    }
}

/* Посилання-картка */
.pet-card-link {
    text-decoration: none !important;
    color: inherit;
}

/* Картка на головній – базовий стиль */
.pet-memorial-item {
    background: #ffffff;
    border: 1px solid #efe8e2;
    border-radius: 18px;
    padding: 18px 18px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pet-memorial-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* Фото на головній – квадрат */
.pet-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 10px;
    background: #faf6f4;
}

.pet-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Назва – до двох рядків */
.pet-memorial-item h3 {
    margin: 4px 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #444;
    text-align: center;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================================
   5. VIEW ALL BUTTON
   ============================================================ */

.pet-view-all {
    text-align: center;
    margin-top: 100px;
    margin-bottom: 10px;
}

.pet-view-all-btn {
    display: inline-block;
    padding: 18px 34px;
    background: #fef7f2;
    border: 1px solid #e8d8c7;
    border-radius: 12px;
    color: #5a5a5a !important;
    font-size: 20px;
    font-weight: 500;
    text-decoration: none !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
}

.pet-view-all-btn:hover {
    background: #f2ebe6;
    border-color: #dacfc7;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}


/* ============================================================
   6. ANIMATIONS
   ============================================================ */

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}











/* ===== FIX: archive "Памʼятні записи" mobile image ===== */

/* Сітка галереї */
.pet-gallery{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* Картка */
.pet-gallery-item{
  width: 100%;
}

/* Лінк-картка */
.pet-gallery-link{
  display: block;
  text-decoration: none;
}

/* Контейнер фото — ключове */
.pet-gallery-img{
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
}

/* ВАЖЛИВО: робимо img "нормальним" */
.pet-gallery-img img{
  display: block;
  width: 100%;
  height: auto;      /* <-- прибирає смужку */
  max-width: 100%;
}

/* Якщо хочеш однакові по висоті фото-картки (гарно) */
@media (min-width: 769px){
  .pet-gallery-img{
    aspect-ratio: 4 / 3;
  }
  .pet-gallery-img img{
    height: 100%;
    object-fit: cover;
  }
}

/* Мобільний: одна колонка, нормальне фото */
@media (max-width: 768px){
  .pet-gallery{
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pet-gallery-img{
    aspect-ratio: 4 / 3;   /* можеш зробити 1/1 якщо хочеш квадрат */
  }

  .pet-gallery-img img{
    height: 100%;
    object-fit: cover;
  }
}




