/* css/styles.css */
:root {
  --env-font-family: 'Source Sans Pro', sans-serif;
  --env-font-color: #222222;
  --env-background-color: #ffffff;
  --env-header-background: #377D7A;
  --header-height: 4rem;
  --filter-height: 3rem;
  --sidebar-width: 300px;
  --content-max-width: 1000px;
  --gap: 1rem;
  --border-color: #ccc;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--env-font-family);
  color: var(--env-font-color);
  background: var(--env-background-color);
}

header {
  background: var(--env-header-background);
  color: #fff;
  padding: 1rem 2rem;
  text-align: center;
}

.subtitle {
  margin-top: 0.5rem;
  font-weight: 300;
}

.disclaimer {
  max-width: 800px;
  margin: 1rem auto;
  padding: 1rem;
  background: #fff;
  border-left: 5px solid #FFA500;
  font-size: 0.95rem;
}

.disclaimer a {
  color: #004c6c;
  text-decoration: underline;
}

.controls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 1rem 1rem;
}

.filter label,
.sort label {
  margin-right: 0.5rem;
}

.sort select {
  font-size: 1rem;
  padding: 0.25rem;
}

/* --- Desktop och breda skärmar --- */
.grid-layout {
  display: grid;
  grid-template-areas:
    "top    top     top"
    "left   content right";
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  grid-template-rows: auto 1fr;
  gap: var(--gap);
  padding: 0 1rem 1rem;
  width: 100%;
}

.top-list-container {
  grid-area: top;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem;
}

.top-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.sidebar.left {
  grid-area: left;
}

.sidebar.right {
  grid-area: right;
}

.content-display {
  grid-area: content;
  position: relative;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  overflow: hidden;
}

.content-display iframe,
.content-display video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  margin: 0;
  max-height: calc(
    100vh
    - var(--header-height)
    - var(--filter-height)
    - 2rem
  );
}

.sidebar {
  background: #f9f9f9;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  max-height: calc(100vh - var(--header-height) - var(--filter-height) - 2rem);
  overflow-y: auto;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.sidebar-item {
  position: relative;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.sidebar-item img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Ta bort tidigare pseudo‐pil 
.sidebar-item::after {
  content: "↗";
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  padding: 2px;
  font-size: 1rem;
}
*/

.info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.title {
  font-weight: 600;
  color: #004c6c;
}

.description {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.tag {
  font-size: 0.75rem;
  margin-top: 0.3rem;
  background: #e0f0f8;
  color: #004c6c;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Nu visas pil‐knappen */
.open-new {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  color: #004c6c;
}

.open-new:hover {
  color: #022a2a;
}

.hidden {
  display: none !important;
}

/* --- Mobil och padd (≤900px) --- */
@media (max-width: 900px) {
  .grid-layout {
    grid-template-areas:
      "top"
      "content"
      "left"
      "right";
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }
  .content-display {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--env-background-color);
    max-width: none;
    margin: 0;
  }
  .content-display iframe,
  .content-display video {
    max-height: none;
  }
  .sidebar {
    max-height: none;
  }
}
