/* =========================================================
   myGasztro – GASZTROTÁR (Recept Lista) CUSTOM CSS
   Helye: /myg-design/myg-gasztrotar-custom.css
   ========================================================= */

/* --- 1. FŐ RÁCS JAVÍTÁSA (GRID) --- */
/* Ez biztosítja, hogy a kártyák egymás MELLETT legyenek */
.myg-gasztrotar-wrapper .myg-recipe-grid,
.myg-recipe-grid {
  display: grid !important;
  /* Min 300px széles kártyák, kitöltik a helyet */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 30px !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* =========================================================
   KERESŐ PANEL JAVÍTÁS (Működő lenyíló + Szimmetria)
   ========================================================= */

/* A panel alapja */
.myg-search-panel {
  background: #fff;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  margin-bottom: 40px;
  border: 1px solid rgba(0,0,0,0.05);
}

/* Form konténer */
.myg-search-form {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Távolság a felső és alsó blokk között */
}

/* --- 1. FELSŐ SOR (Fix Grid) --- */
.myg-search-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 egyenlő oszlop */
  gap: 20px;
  width: 100%;
  align-items: end;
}

/* --- 2. ALSÓ SOR (Részletes keresés - JS kezeli a megjelenést!) --- */
/* FONTOS: Nem adunk meg display-t, mert azt a JS állítja (none/flex) */
.myg-advanced-search {
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  align-items: end;
  /* Ha a JS megjeleníti (display:flex), akkor ez a gap érvényesül */
}

/* --- MEZŐK SZÉLESSÉGE --- */
/* A felső sorban a Grid automatikusan intézi. 
   Az alsóban (Flex) ki kell számolnunk, hogy pont akkora legyen. */

.myg-search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%; /* Alapértelmezett */
}

/* Csak az alsó sorban lévő mezők kényszerítése 3 oszlopra */
.myg-advanced-search .myg-search-field {
  /* Matek: (100% szélesség - 2db 20px-es lyuk) / 3 elem */
  width: calc((100% - 40px) / 3) !important;
  flex: 0 0 calc((100% - 40px) / 3) !important;
}

/* Címkék (Label) */
.myg-search-field label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
}

/* Input és Select - Teljesen egyforma stílus */
.myg-search-field input,
.myg-search-field select,
.myg-search-field .myg-input,
.myg-search-field .myg-select {
  width: 100% !important; 
  height: 48px !important; 
  border: 1px solid #e0e0e0 !important;
  border-radius: 10px !important;
  padding: 0 15px !important;
  background-color: #f9f9f9 !important;
  font-size: 14px !important;
  color: #333 !important;
  transition: all 0.2s ease;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.myg-search-field input:focus,
.myg-search-field select:focus {
  background-color: #fff !important;
  border-color: #FF8630 !important;
  box-shadow: 0 0 0 3px rgba(255, 134, 48, 0.1) !important;
  outline: none;
}

/* --- GOMBOK ÉS LINKEK SORA (ALUL) --- */
.myg-search-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
}

/* Részletes keresés link */
.myg-advanced-toggle {
  color: #FF8630;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px dashed rgba(255, 134, 48, 0.4);
  cursor: pointer;
}

.myg-advanced-toggle:hover {
  border-bottom-style: solid;
}

/* Keresés gomb (11px padding) */
.myg-search-button {
  background-color: #FF8630;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 60px; /* KÉRTÉK: 11px magasság */
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 134, 48, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 150px;
  text-align: center;
  height: auto;
  line-height: normal;
}

.myg-search-button:hover {
  background-color: #e67320;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 134, 48, 0.4);
}

/* --- MOBIL ÉS TABLET FIX --- */

/* Tablet (pl. iPad) - 2 oszlopra váltunk */
@media (max-width: 900px) {
  .myg-search-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Alsó sor 2 oszlopos matekja: (100% - 20px lyuk) / 2 */
  .myg-advanced-search .myg-search-field {
    width: calc((100% - 20px) / 2) !important;
    flex: 0 0 calc((100% - 20px) / 2) !important;
  }
}

/* Mobil - 1 oszlopra váltunk */
@media (max-width: 600px) {
  .myg-search-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Alsó sor 1 oszlopos (teljes szélesség) */
  .myg-advanced-search .myg-search-field {
    width: 100% !important;
    flex: 0 0 100% !important;
  }
  
  .myg-search-actions {
    flex-direction: column-reverse;
    gap: 15px;
    align-items: stretch;
  }
  
  .myg-search-button {
    width: 100%;
    padding: 12px;
  }
  
  .myg-advanced-toggle {
    text-align: center;
    padding: 10px;
  }
}

/* =========================================================
   RECEPT KÁRTYA STÍLUS (Fix magasságú címmel)
   ========================================================= */

.myg-recipe-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  position: relative;
}

.myg-recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

/* --- 1. HEADER (Cím + Meta) --- */
.myg-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 15px;
}

/* Cím (FIX 2 SOR MAGASSÁG + Kecsesebb font + Nagyobb méret) */
.myg-card-title {
  font-size: 18px; /* <--- EZT A SZÁMOT NÖVELTED MOST (pl. 18px vagy 19px) */
  font-weight: 600; /* Ez a finomított vastagság */
  line-height: 1.35;
  height: 2.7em; /* Ez automatikusan igazodik a fenti mérethez, ezt NE bántsd! */
  
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  
  color: #222;
  margin: 0 0 12px 0;
  
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.myg-card-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.myg-card-title a:hover {
  color: #FF8630;
}

/* Meta sor (Kategória, Idő, Nehézség) */
.myg-card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Közös alapstílus a címkéknek */
.myg-meta-category,
.myg-meta-time,
.myg-meta-difficulty {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
}

/* Kategória (Narancs) */
.myg-meta-category {
  background: rgba(255, 134, 48, 0.15);
  color: #FF8630;
}

/* Idő és Nehézség (Szürke) */
.myg-meta-time,
.myg-meta-difficulty {
  background: #f5f5f5;
  color: #777;
}

/* --- 2. KÉP (1:1 Négyzet) --- */
.myg-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 15px;
  background: #f9f9f9;
  position: relative;
}

.myg-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.myg-recipe-card:hover .myg-card-img {
  transform: scale(1.08);
}

/* --- 3. MAKRÓK (Alsó rács) --- */
.myg-card-nutrition {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(0,0,0,0.04);
  
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.myg-card-nutrition-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fcfcfc;
  border-radius: 8px;
  padding: 8px 2px;
}

.myg-card-nutrition-value {
  font-size: 13px;
  font-weight: 800;
  color: #333;
  margin-bottom: 3px;
}

.myg-card-nutrition-label {
  font-size: 9px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- MOBIL FIX --- */
@media (max-width: 480px) {
  .myg-recipe-card {
    padding: 15px;
  }
  
  .myg-card-title {
    font-size: 16px;
    height: 2.7em; /* Mobilon is fix 2 sor */
  }
  
  .myg-meta-category,
  .myg-meta-time,
  .myg-meta-difficulty {
    font-size: 10px;
    padding: 4px 8px;
  }
}

/* =========================================================
   "TÖBB BETÖLTÉSE" GOMB STÍLUS (Load More)
   Ha Áron ilyen gombot rakott be, ez szépen megformázza
   ========================================================= */

/* A gomb konténere (hogy középen legyen) */
.myg-load-more-wrapper,
.load-more-container,
.mygasztro-pagination {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  width: 100%;
  clear: both;
}

/* Maga a gomb */
.myg-load-more-btn,
.load-more-btn,
/* Wordpress alapértelmezett gombok elkapása */
.myg-load-more-wrapper button,
.myg-load-more-wrapper a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #fff; /* Alapból fehér */
  color: #FF8630; /* Narancs szöveg */
  border: 2px solid #FF8630; /* Narancs keret */
  border-radius: 12px;
  padding: 12px 35px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255, 134, 48, 0.1);
}

/* Hover állapot (Amikor ráviszed az egeret) */
.myg-load-more-btn:hover,
.load-more-btn:hover,
.myg-load-more-wrapper button:hover,
.myg-load-more-wrapper a.button:hover {
  background-color: #FF8630;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 134, 48, 0.25);
}

/* Betöltés közben (opcionális, ha van loading state) */
.loading .myg-load-more-btn {
  opacity: 0.7;
  cursor: wait;
}