/* KulturtankenFeed Plugin Styles - Based on Kulturtanken Design System */

@import url(https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap);

/* Base Styles */
.kulturtanken-feed {
  font-family: 'Merriweather Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  color: #000;
  background: #fff;
  word-break: break-word;
  word-wrap: break-word;
}

/* Wrapper */
.wrapper {
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

@media only screen and (max-width: 1023px) {
  .wrapper {
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* Block Title */
.block-latest-news__title {
  font-size: 30px;
  font-weight: 700;
  color: #000;
  font-family: 'Merriweather', serif;
  line-height: 1.3;
  margin: 1.8rem 0 1rem;
  text-align: left;
}

/* Taxonomy Filter */
.taxonomy-filter-container {
  margin-bottom: 3rem;
}

.taxonomy-filter {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.taxonomy-filter__title {
  font-size: 16px;
  font-weight: 700;
  color: #000;
  font-family: 'Merriweather Sans', sans-serif;
  margin: 0;
}

.taxonomy-filter-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.taxonomy-filter-menu__toggle {
  display: none;
  background: #094e58;
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Merriweather Sans', sans-serif;
  font-weight: 400;
}

.taxonomy-filter-menu__item {
  background: none;
  border: 0;
  color: black;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 400;
  font-family: 'Merriweather Sans', sans-serif;
  transition: all 0.3s ease;
  text-decoration: none;
}

.taxonomy-filter-menu__item:hover {
  color: #094e58;
}

.taxonomy-filter-menu__item--is-active {
  background: none;
  border: 0;
  color: #094e58;
}

.taxonomy-filter-menu__item:focus {
  outline: 3px solid #f9a148;
}

/* News Grid */
.block-latest-news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 2rem;
}

.block-latest-news-grid-left-column,
.block-latest-news-grid-right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.block-latest-news-grid-left-column {
    display: block;
    justify-items: end;
    margin-top: auto;
    margin-bottom: 7px;
}

.block-latest-news-grid-left-column .post-item:first-child {
    max-height: 450px;
    margin-bottom: 30px;
}

.block-latest-news-grid-right-column {
    display: inline-block;
}

.block-latest-news-grid-right-column .post-item {
    width: 100%;
    max-height: 280px;
}

.block-latest-news-grid-right-column .post-item:first-child {
    min-width: 100%;
    margin: 10px 0 10px 10px;
}

.block-latest-news-grid-right-column .post-item:not(:first-child) {
    width: calc(50% - 5px);
    display: inline-flex;
}

.block-latest-news-grid-right-column .post-item:nth-child(2n+1) {
    float: right;
}

/* Post Items */
.post-item {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
  position: relative;
}

.post-item:hover {
    transform: translateY(0);

    text-decoration: none;
  color: inherit;
}

.post-item:focus {
  outline: 3px solid #f9a148;
}

.post-item--post_vertical {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 380px;
}

.block-latest-news-grid-right-column .post-item:first-child .post-item-text {
    /*width: 100%;*/
    min-width: 575px;
}

.post-item--post_horizontal {
  display: flex;
  flex-direction: row;
  min-height: 200px;
}

.post-item--post_square {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1;

}

.button.hide-on-mobile {
    border-radius: 8px;
    border: 2px solid #000;
    background-color: #000;
    text-align: center;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 12px 14px;
}

.button.hide-on-mobile:hover {
    background-color: transparent;
    color: #000;
}

/* Post Thumbnails */
.post-item-thumbnail {
  overflow: hidden;
  position: relative;
}

.post-item-thumbnail:after {
    content: "";
    position: absolute;
    height: 50%;
    width: 100%;
    left: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, .7) 30%, transparent);
}

.post-item--post_horizontal .post-item-thumbnail {
  flex: 0 0 40%;
}

.post-item--post_square .post-item-thumbnail {
  flex: 1;
}

.post-item-thumbnail img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.block-latest-news-grid-right-column .post-item-thumbnail img {
  height: 300px;
}

.post-item:hover .post-item-thumbnail img {
  transform: scale(1.05);
}

/* Post Text */
.post-item-text {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: absolute;
  bottom: 0;
}

.post-item--post_horizontal .post-item-text {
  flex: 1;
}

.post-item__title {
  font-size: 20px;
  font-weight: 700;
  color: white;
  font-family: 'Merriweather Sans', sans-serif;
  line-height: 1.3;
  margin: 0 0 1rem 0;
}

.post-item--post_square .post-item__title {
  font-size: 16px;
}

.post-item__footer {
    display: none;
}

.post-item:hover .post-item__footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.post-item:hover .post-item-text {
    background: #ceeddd;
}

.post-item:hover .post-item__title {
    color: #094e58;
}

.post-item__excerpt {
  flex: 1;
}

.post-item__excerpt p {
  color: #6c757d;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  font-family: 'Merriweather Sans', sans-serif;
  font-weight: 300;
}

.post-item__icon-wrapper {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.sprite-icon {
  width: 100%;
  height: 100%;
  fill: #094e58;
  transition: transform 0.3s ease;
  display: inline-block;
}

.post-item:hover .sprite-icon {
  transform: translateX(4px);
}

.sprite-icon-button-arrow {
  fill: currentColor;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #094e58;
  color: white;
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  font-weight: 400;
  font-size: 15px;
  font-family: 'Merriweather Sans', sans-serif;
  transition: background-color 0.3s ease;
  align-self: flex-start;
  border: none;
  cursor: pointer;
}

.button:hover {
  background: #0a5a66;
  color: white;
  text-decoration: none;
}

.button:focus {
  outline: 3px solid #f9a148;
}

.button .sprite-icon {
  fill: currentColor;
  width: 18px;
  height: 18px;
}

/* Responsive Design */
@media (max-width: 1023px) {
  .wrapper {
    padding: 0 20px;
  }

  .block-latest-news__title {
    font-size: 25px;
  }

  .block-latest-news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .taxonomy-filter-menu {
    position: relative;
  }

  .taxonomy-filter-menu__toggle {
    display: block;
    width: 100%;
    text-align: left;
  }

  .taxonomy-filter-menu__item {
    display: none;
    width: 100%;
    text-align: left;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin: 0;
  }

  .taxonomy-filter-menu__item:first-of-type {
    border-top: none;
  }

  .taxonomy-filter-menu--open .taxonomy-filter-menu__item {
    display: block;
  }

  .post-item--post_horizontal {
    flex-direction: column;
  }

  .post-item--post_horizontal .post-item-thumbnail {
    flex: none;
    height: 200px;
  }

  .hide-on-mobile {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .hide-on-desktop {
    display: none !important;
  }
}

/* Focus and Accessibility */
a:focus,
area:focus,
button:focus {
  outline: 3px solid #f9a148;
}

.with-hovers a:hover,
.with-hovers area:hover,
.with-hovers button:hover,
input:focus,
textarea:focus {
  outline: none;
}

input.focus-visible,
input:focus-visible,
textarea.focus-visible,
textarea:focus-visible {
  outline: 3px solid #f9a148;
}

/* Screen Reader Text */
.screen-reader-text {
  border: 0;
  padding: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  position: absolute;
}

.screen-reader-text:active,
.screen-reader-text:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  position: static;
}

/* Loading States */
.kulturtanken-feed.loading,
.block-latest-news-grid.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.kulturtanken-feed.loading::after,
.block-latest-news-grid.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #094e58;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}

.taxonomy-filter-menu.loading {
  opacity: 0.6;
  pointer-events: none;
}

.taxonomy-filter-menu.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 10px;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 0;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #094e58;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error States */
.kulturtanken-feed-error,
.kulturtanken-feed-empty,
.no-posts-message,
.error-message {
  padding: 2rem;
  text-align: center;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 1rem 0;
}

.kulturtanken-feed-error p,
.kulturtanken-feed-empty p,
.no-posts-message p,
.error-message p {
  color: #6c757d;
  font-family: 'Merriweather Sans', sans-serif;
  margin: 0;
}

.error-message {
  background: #ffeaea;
  border: 1px solid #e4151e;
}

.error-message p {
  color: #e4151e;
}

/* Additional Kulturtanken Brand Colors */
:root {
  --kulturtanken-primary: #094e58;
  --kulturtanken-secondary: #f9a148;
  --kulturtanken-text: #000;
  --kulturtanken-text-light: #6c757d;
  --kulturtanken-background: #fff;
  --kulturtanken-border: #e9ecef;
}

/* Utility Classes */
.kulturtanken-feed a {
  color: inherit;
  text-decoration: none;
}

.kulturtanken-feed a:hover {
  text-decoration: none;
}

.kulturtanken-feed .hidden {
  display: none !important;
}

.kulturtanken-feed .align-center {
  text-align: center;
}

/* Print Styles */
@media print {
  .taxonomy-filter-container,
  .button {
    display: none;
  }

  .post-item {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
/* 
Widget-specific styles */
.widget .kulturtanken-feed,
.widget .wrapper {
	max-width: none;
	padding: 0;
}

.widget .block-latest-news__title {
	font-size: 1.5rem;
	margin-bottom: 1rem;
}

.widget .block-latest-news-grid {
	grid-template-columns: 1fr;
	gap: 1rem;
}

.widget .post-item--post_horizontal {
	flex-direction: column;
}

.widget .post-item--post_horizontal .post-item-thumbnail {
	flex: none;
	height: 150px;
}

.widget .post-item__title {
	font-size: 1rem;
}

.widget .post-item--post_square .post-item__title {
	font-size: 0.9rem;
}

.widget .taxonomy-filter-menu {
	flex-wrap: wrap;
	gap: 0.25rem;
}

.widget .taxonomy-filter-menu__item {
	font-size: 0.8rem;
	padding: 0.5rem 0.75rem;
}

.widget .button {
	font-size: 0.85rem;
	padding: 0.75rem 1rem;
}

/* Widget in narrow sidebars */
.widget_kulturtanken_feed_widget .taxonomy-filter-container {
	margin-bottom: 1.5rem;
}

.widget_kulturtanken_feed_widget .taxonomy-filter-menu__toggle {
	display: block;
	width: 100%;
}

.widget_kulturtanken_feed_widget .taxonomy-filter-menu__item {
	display: none;
	width: 100%;
	text-align: left;
	border-radius: 0;
	border-left: none;
	border-right: none;
}

.widget_kulturtanken_feed_widget .taxonomy-filter-menu--open .taxonomy-filter-menu__item {
	display: block;
}

/* Print styles for widgets */
@media print {
	.widget .taxonomy-filter-container,
	.widget .button {
		display: none;
	}
	
	.widget .post-item {
		box-shadow: none;
		border: 1px solid #ccc;
		break-inside: avoid;
		margin-bottom: 1rem;
	}
}