/**
 * Kategori-artikkelvisning
 * Ekstra CSS for å fikse visning av kategori-poster i megamenyen
 */

/* Styling av kategoribokser */
.gdm-posts-column,
.gdm-category-posts-wrapper,
.gdm-standard-posts-section,
.gdm-standard-posts-grid,
.gdm-posts-list {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Vis indikator for menyelementer med kategoriinnhold */
.gdm-has-posts .gdm-posts-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--g-accent, #e84d0e);
  margin-left: 5px;
  vertical-align: super;
}

.gdm-top-has-posts:after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--g-accent, #e84d0e);
  margin-left: 5px;
  vertical-align: super;
}

/* Styling av kategoritittel */
.gdm-posts-heading,
.gdm-category-title,
.gdm-posts-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--g-primary, #005d8f);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Legg til tittel for kategori */
.gdm-posts-column {
  margin-top: 1rem;
  padding-top: 0.5rem;
  clear: both;
}

/* Kategoriartikkelboks for undernivå */
.gdm-category-posts-wrapper {
  margin-top: 0.5rem;
  background-color: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  max-width: 300px;
}

/* Kategorivisning i standard megameny */
.gdm-posts-list,
.gdm-category-posts-wrapper .gdm-article-card {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.gdm-posts-list li,
.gdm-article-card {
  margin-bottom: 0.75rem;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.gdm-posts-list li:hover,
.gdm-article-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Artikkelkort i megameny */
.gdm-article-card {
  display: flex;
  margin-bottom: 1rem;
}

.gdm-article-thumbnail {
  flex: 0 0 80px;
  height: 80px;
  overflow: hidden;
}

.gdm-article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gdm-article-content {
  flex: 1;
  padding: 0.5rem;
}

.gdm-article-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.gdm-article-title a {
  color: inherit;
  text-decoration: none;
}

.gdm-article-meta {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.gdm-article-excerpt {
  font-size: 0.8rem;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Standard liste i megameny */
.mega-columns .gdm-posts-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex !important;
  flex-wrap: wrap;
  gap: 1rem;
}

.mega-columns .gdm-posts-list li {
  flex: 0 0 31%;
  margin: 0;
}

.gdm-post-item {
  display: flex;
  padding: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.gdm-post-thumbnail {
  flex: 0 0 60px;
  height: 60px;
  margin-right: 10px;
  overflow: hidden;
}

.gdm-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gdm-post-content {
  flex: 1;
}

.gdm-post-title {
  font-size: 0.9rem;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  font-weight: 500;
}

.gdm-post-meta {
  font-size: 0.7rem;
  color: #666;
}

/* Standard artikkelvisning */
.gdm-standard-posts-section {
/*  margin-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
  */
}

.gdm-standard-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* Placeholder */
.gdm-article-card.gdm-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  background: #f5f5f5;
  color: #999;
  font-style: italic;
}

/* Se alle link */
.gdm-see-all,
.gdm-view-all,
.gdm-posts-footer,
.gdm-category-posts-footer {
  display: block;
  margin-top: 0.5rem;
  text-align: right;
}

.gdm-see-all,
.gdm-view-all {
  color: var(--g-accent, #e84d0e);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.gdm-see-all:hover,
.gdm-view-all:hover {
  text-decoration: underline;
}

/* Debug panel og info */
.gdm-debug-panel {
  background: #fff0f0;
  color: #c00;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px dashed #c00;
}

.gdm-debug-info {
  display: block;
  font-size: 0.7rem;
  color: #c00;
  background: #fff0f0;
  padding: 0.25rem;
  margin-top: 0.25rem;
  border-radius: 4px;
}

/* Mobil */
@media (max-width: 768px) {
  .mega-columns .gdm-posts-list {
    flex-direction: column;
  }
  
  .mega-columns .gdm-posts-list li {
    flex: 0 0 100%;
    margin-bottom: 1rem;
  }
  
  .gdm-standard-posts-grid {
    grid-template-columns: 1fr;
  }
  
  .gdm-article-card {
    margin-bottom: 0.75rem;
  }
  
  .gdm-article-thumbnail {
    flex: 0 0 60px;
    height: 60px;
  }
  
  .gdm-article-excerpt {
    display: none;
  }
}

/* Mulig tilpasninger for spesifikke tema-farger */
body.oslo .gdm-article-title a:hover,
body.oslo .gdm-see-all,
body.oslo .gdm-view-all {
  color: #0074d9;
}

body.bergen .gdm-article-title a:hover,
body.bergen .gdm-see-all,
body.bergen .gdm-view-all {
  color: #9c4d9e;
}

body.tromso .gdm-article-title a:hover,
body.tromso .gdm-see-all,
body.tromso .gdm-view-all {
  color: #e63c4f;
}
