/* styles.css for masterbuilder.pl - modern lego fanpage */
body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: #f7f7f7;
  color: #222;
}
header {
  background: linear-gradient(90deg, #ffd600 0%, #ff3c00 100%);
  padding: 1.5rem 0 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
#logo {
  margin: 0.5rem;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
nav {
  flex: 1;
}
nav ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}
nav ul li {
  display: flex;
  align-items: center;
}
nav ul li a {
  text-decoration: none;
  color: #222;
  font-weight: 600;
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
nav ul li a:hover {
  background: #ff3c00;
  color: #fff;
}
form[action="/en/search/"], form[action="/pl/search/"] {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  margin: 0;
}
input[name="q"] {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  width: 220px;
  transition: border 0.2s;
}
input[name="q"]:focus {
  border: 1.5px solid #ff3c00;
  outline: none;
}
main {
  max-width: 900px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 2rem;
}
footer {
  text-align: center;
  padding: 2rem 0 1rem 0;
  color: #888;
  font-size: 1rem;
}
.post-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.post-main-image {
  display: block;
  max-width: 800px;
  width: 100%;
  height: auto;
  margin: 0 auto 2rem auto;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}
.post-content {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #222;
}
.post-image {
  max-width: 90%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
}
.instruction-button {
  background-color: rgb(72, 21, 126);
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 1rem 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.instruction-button:hover {
    background-color: rgb(90, 30, 150);
}

/* --- FINAL CORRECTED STYLES FOR POST TILES --- */

.search-results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-tile {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  display: flex;
  position: relative;
}
.search-tile:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.search-tile-img-link {
  flex-shrink: 0;
  width: 320px;
  background: #ffd600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}

.search-tile-img {
  display: block;
  width: 100%;
  height: 100%; /* This is key for mobile view */
  object-fit: contain; /* This is the fix for cropping */
  border-radius: 8px;
}

.search-tile-content {
  padding: 1rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-tile-main {
  flex-grow: 1;
}

.search-tile-content h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.3rem;
  line-height: 1.3;
}
.search-tile-content h3 a {
    text-decoration: none;
    color: inherit;
}

.search-tile-content .post-meta {
  margin-bottom: 0.75rem;
}

.search-tile-content .post-date {
  color: #888;
  font-size: 0.9rem;
}

.search-tile-content p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #444;
}

/* --- Stretched Link Technique --- */
.stretched-link-target::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
}

/* --- Styles for Tags --- */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  display: inline-block;
  background-color: #eee;
  color: #555;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  position: relative;
  z-index: 2;
}
.tag:hover {
  background-color: #ff3c00;
  color: #fff;
}
.tag-highlight {
  color: #ff3c00;
  background-color: #fff2cc;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
}

/* Meta header for individual post pages */
.post-meta-header {
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}
.post-meta-header .post-date {
  font-size: 0.9rem;
  color: #777;
  font-weight: 500;
}

/* --- RESPONSIVE STYLES --- */

@media (max-width: 900px) {
  .header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  nav ul {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Styles for narrow screens (e.g., mobile) */
@media (max-width: 600px) {
  main {
    padding: 1rem;
    margin: 1rem;
  }
  nav ul {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  header {
    padding: 1rem 0.5rem;
  }
  #logo-img {
    content: url('/public/logo-tiny.png');
    width: 48px;
    height: 48px;
  }
  .post-title {
    font-size: 1.5rem;
  }
  
  /* Switch to vertical layout on small screens */
  .search-tile {
    flex-direction: column;
  }
  .search-tile-img-link {
    width: 100%;
  }
  .search-tile-content {
    padding: 1rem;
  }
}