/* ============================================================
   Föremålslexikon plugin - frontend styles
   ============================================================ */

.df-for-root {
  max-width: 100%;
  margin: 20px 0;
}

.df-for-intro {
  background: #fdf6e3;
  border-left: 4px solid #800000;
  padding: 14px 18px;
  margin: 0 0 24px 0;
  border-radius: 4px;
}

.df-for-intro p {
  margin: 0;
}

/* === SÖK OCH FILTER === */
.df-for-controls {
  margin: 20px 0 30px 0;
}

.df-for-controls input[type="search"] {
  width: 100%;
  max-width: 500px;
  padding: 12px 18px;
  font-size: 1em;
  border: 2px solid #ddd;
  border-radius: 4px;
  background: #fff;
  margin-bottom: 12px;
}

.df-for-controls input[type="search"]:focus {
  border-color: #800000;
  outline: none;
}

.df-for-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.df-for-filter {
  padding: 8px 16px;
  background: #fff;
  color: #333;
  border: 1.5px solid #800000;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 1 auto;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1.2;
}

.df-for-filter:hover {
  background: #fdf6e3;
  color: #800000;
  border-color: #800000;
}

.df-for-filter-active {
  background: #800000;
  color: #fff;
  border-color: #800000;
}

.df-for-filter-active:hover {
  background: #b00000;
  color: #fff;
}

/* === KORT-RUTNÄT === */
.df-for-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 18px;
  margin: 24px 0;
}

.df-for-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  min-width: 0;
  transition: all 0.15s;
}

.df-for-card:hover {
  border-color: #800000;
  box-shadow: 0 4px 12px rgba(128, 0, 0, 0.12);
  transform: translateY(-2px);
}

.df-for-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.df-for-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #faf6e9;
  position: relative;
}

.df-for-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.df-for-card-noimage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #fdf6e3 0%, #f4e8c3 100%);
  color: #a07628;
  user-select: none;
}

.df-for-noimage-icon {
  font-size: 2.5em;
  opacity: 0.6;
}

.df-for-noimage-text {
  font-size: 0.85em;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.df-for-card-body {
  padding: 14px 16px;
}

.df-for-card-title {
  margin: 0 0 6px 0;
  font-size: 1.15em;
  color: #800000;
  line-height: 1.3;
}

.df-for-card-synonyms {
  margin: 0 0 8px 0;
  font-size: 0.83em;
  color: #888;
  font-style: italic;
  line-height: 1.4;
}

.df-for-card-usage {
  margin: 0;
  font-size: 0.9em;
  color: #555;
  line-height: 1.5;
}

/* "Inga resultat" */
.df-for-noresults {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* === SINGLE FÖREMÅL === */
.df-for-single {
  max-width: 100%;
}

.df-for-single-image {
  margin: 0 0 24px 0;
  border-radius: 6px;
  overflow: hidden;
  background: #faf6e9;
}

.df-for-single-image img {
  width: 100%;
  height: auto;
  display: block;
}

.df-for-fakta {
  background: #f8f9fa;
  border-left: 4px solid #800000;
  padding: 14px 18px;
  margin: 0 0 24px 0;
  border-radius: 4px;
}

.df-for-fakta p {
  margin: 4px 0;
  font-size: 0.95em;
}

.df-for-content {
  margin: 20px 0;
  line-height: 1.7;
}

/* "Liknande föremål" på single */
.df-for-see-also {
  background: #f0f9ff;
  border-left: 4px solid #3b82f6;
  padding: 18px 20px;
  margin: 30px 0;
  border-radius: 4px;
}

.df-for-see-also h3 {
  margin: 0 0 14px 0;
  font-size: 1em;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.df-for-see-also-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 12px;
}

.df-for-see-also-card {
  display: block;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d0e4f5;
  min-width: 0;
  transition: all 0.15s;
}

.df-for-see-also-card:hover {
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.df-for-see-also-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.df-for-see-also-card .df-for-card-noimage {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.df-for-see-also-card .df-for-noimage-icon {
  font-size: 2em;
}

.df-for-see-also-card .df-for-noimage-text {
  display: none;
}

.df-for-see-also-card > span {
  display: block;
  padding: 8px 10px;
  font-size: 0.88em;
  color: #800000;
  text-align: center;
  line-height: 1.3;
  font-weight: 500;
}

/* Tillbaka-länk */
.df-for-back {
  margin: 30px 0 0 0;
  padding-top: 16px;
  border-top: 1px solid #ddd;
}

.df-for-back a {
  color: #800000;
  text-decoration: none;
  font-weight: 500;
}

.df-for-back a:hover {
  text-decoration: underline;
}

/* === INLINE LINK === */
.df-for-inline {
  color: #800000;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: help;
}

.df-for-inline:hover {
  text-decoration-style: solid;
}
