/*
 * Lo Pati - Media · Theme stylesheet (colours/typography from lopati.cat).
 * Copyright (c) Miquel Sancho, MiKi <miki@MKEngineering.org>
 */

:root {
  --lp-accent:        #FF004E;
  --lp-accent-hover:  #CC003E;
  --lp-accent-subtle: #FFCCDC;
  --lp-dark:          #151920;
  --lp-muted:         #78838C;
  --lp-text:          #212529;
  --lp-bg:            #FFFFFF;
  --lp-border:        #DEE2E6;
  --lp-radius:        0.375rem;
  --lp-font: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--lp-font);
  color: var(--lp-text);
  background: var(--lp-bg);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--lp-accent); text-decoration: underline; }
a:hover { color: var(--lp-accent-hover); }

/* ---- Header / nav ---- */
.lp-header {
  background: var(--lp-dark);
  color: #fff;
}
.lp-header__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.lp-logo img { height: 34px; display: block; }
.lp-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  flex-wrap: wrap;
  align-items: center;
}
.lp-nav a {
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding-bottom: 4px;
  border-bottom: solid 5px transparent;
}
.lp-nav a:hover { color: #fff; border-bottom-color: var(--lp-accent); }
.lp-nav a.is-active { border-bottom-color: var(--lp-accent); }
.lp-nav__search { color: var(--lp-accent) !important; }

/* ---- Nav radio player ---- */
.lp-radio { display: inline-flex; align-items: center; gap: 0.5rem; }
.lp-radio__btn {
  width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%;
  border: 2px solid var(--lp-accent); cursor: pointer; line-height: 0;
  display: inline-flex; align-items: center; justify-content: center;
  /* Blink red <-> white while idle to draw attention. */
  animation: lp-radio-blink 1s ease-in-out infinite;
}
.lp-radio__btn svg { width: 1.2rem; height: 1.2rem; fill: currentColor; display: block; }
.lp-radio.is-playing .lp-radio__btn {
  animation: none; background: var(--lp-accent); color: #fff; border-color: #fff;
}
.lp-radio__status { color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
@keyframes lp-radio-blink {
  0%, 100% { background: var(--lp-accent); color: #fff; }
  50%      { background: #fff; color: var(--lp-accent); }
}
@media (prefers-reduced-motion: reduce) {
  .lp-radio__btn { animation: none; background: var(--lp-accent); color: #fff; }
}
@media (max-width: 575px) { .lp-radio__status { display: none; } }
/* Subtle dim while a boosted navigation is in flight. */
body.is-boosting .lp-main { opacity: 0.6; transition: opacity 0.15s ease; }

/* ---- Account dropdown ---- */
.lp-account { position: relative; }
.lp-account > summary {
  list-style: none; cursor: pointer; color: #fff; font-weight: 600;
  text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.02em;
  padding-bottom: 4px; border-bottom: solid 5px transparent;
}
.lp-account > summary::-webkit-details-marker { display: none; }
.lp-account[open] > summary { border-bottom-color: var(--lp-accent); }
.lp-account__menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  min-width: 190px; padding: 0.4rem; z-index: 50;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.lp-account__menu a,
.lp-account__menu button {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.6rem;
  color: var(--lp-text); text-decoration: none; border-radius: var(--lp-radius);
  background: none; border: 0; font: inherit; cursor: pointer;
}
.lp-account__menu a:hover,
.lp-account__menu button:hover { background: var(--lp-accent-subtle); color: var(--lp-accent-hover); }

/* ---- Layout ---- */
.lp-main { flex: 1 0 auto; max-width: 1140px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem; }

.lp-section-title {
  font-weight: 700;
  display: inline-block;
  border-bottom: solid 5px var(--lp-accent);
  padding-bottom: 0.25rem;
  margin: 1.5rem 0 1rem;
}

/* ---- Cards ---- */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}
.lp-card {
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}
.lp-card:hover { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12); }
.lp-card__thumb-link { display: block; line-height: 0; }
.lp-card__thumb { aspect-ratio: 16 / 9; background: var(--lp-dark); object-fit: cover; width: 100%; display: block; transition: opacity 0.15s ease; }
.lp-card__thumb-link:hover .lp-card__thumb { opacity: 0.9; }
.lp-card__body { padding: 0.85rem 1rem; }
.lp-card__title { font-weight: 600; font-size: 1.02rem; margin: 0 0 0.35rem; }
.lp-card__title a { text-decoration: none; color: var(--lp-text); }
.lp-card__title a:hover { color: var(--lp-accent); }
.lp-card__meta { color: var(--lp-muted); font-size: 0.82rem; }

.lp-badge {
  display: inline-block;
  background: var(--lp-accent-subtle);
  color: var(--lp-accent-hover);
  border-radius: 50rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---- Buttons ---- */
.lp-btn {
  display: inline-block;
  background: var(--lp-accent);
  color: #fff;
  border: 1px solid var(--lp-accent);
  border-radius: var(--lp-radius);
  padding: 0.5rem 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.lp-btn:hover { background: var(--lp-accent-hover); color: #fff; }

/* ---- Embeds ---- */
.lp-embed { position: relative; aspect-ratio: 16 / 9; }
.lp-embed iframe, .lp-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Filters ---- */
.lp-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1.5rem; }

/* ---- Footer ---- */
.lp-footer {
  background: var(--lp-dark);
  color: #cbcfd1;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
}
.lp-footer__inner { max-width: 1140px; margin: 0 auto; font-size: 0.85rem; }
.lp-footer a { color: #fff; }

/* ---- Search box ---- */
.lp-searchbox { display: flex; gap: 0.5rem; margin: 1rem 0; }
.lp-searchbox input[type="search"] {
  flex: 1; padding: 0.55rem 0.75rem;
  border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
}

/* ---- Forms ---- */
.lp-form-card {
  max-width: 580px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  padding: 1.75rem;
  background: #fff;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.04);
}
.lp-form-card--wide { max-width: 780px; }
.lp-auth { max-width: 420px; margin: 2.5rem auto; }

.lp-form__group { margin-bottom: 1.15rem; }
.lp-form__group > label {
  display: block; font-weight: 600; font-size: 0.9rem;
  margin-bottom: 0.4rem; color: var(--lp-text);
}
.lp-field {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
  font-family: inherit; font-size: 1rem; color: var(--lp-text);
  background: #fff; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lp-field:focus {
  outline: none; border-color: var(--lp-accent);
  box-shadow: 0 0 0 0.2rem rgba(255, 0, 78, 0.18);
}
textarea.lp-field { min-height: 5rem; resize: vertical; }
.lp-field--select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2378838C'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
}
select[multiple].lp-field { min-height: 7rem; background-image: none; padding-right: 0.75rem; }
.lp-file { display: block; font-size: 0.9rem; }
.lp-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.lp-check__input { width: 1.1rem; height: 1.1rem; accent-color: var(--lp-accent); }
.lp-form__help { margin: 0.35rem 0 0; color: var(--lp-muted); font-size: 0.82rem; }
.lp-form__error { margin: 0.35rem 0 0; color: var(--lp-accent); font-size: 0.82rem; font-weight: 600; }
.has-error .lp-field { border-color: var(--lp-accent); }
.lp-form__alert {
  background: var(--lp-accent-subtle); color: var(--lp-accent-hover);
  border-radius: var(--lp-radius); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem;
}
.lp-form__req { color: var(--lp-accent); }
.lp-form__actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }

/* ---- Kind choice tiles ---- */
.lp-kinds {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem; max-width: 780px;
}
.lp-kind-tile {
  display: block; border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
  padding: 1.75rem 1.25rem; text-align: center; text-decoration: none;
  color: var(--lp-text); font-weight: 600; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.lp-kind-tile:hover {
  border-color: var(--lp-accent); box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  transform: translateY(-2px); color: var(--lp-accent);
}
.lp-kind-tile__icon { font-size: 2.25rem; display: block; margin-bottom: 0.5rem; }
.lp-kind-tile__hint { display: block; font-weight: 400; font-size: 0.82rem; color: var(--lp-muted); margin-top: 0.35rem; }

/* ---- Two-column item form ---- */
.lp-item-form { max-width: 1040px; }
.lp-cols {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.lp-col--main {
  border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
  padding: 1.5rem; background: #fff;
}
.lp-col--side {
  border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
  padding: 1.25rem; background: #f8f9fa;
}

/* ---- Rich-text editor ---- */
.lp-rt__bar { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.4rem; }
.lp-rt__btn {
  min-width: 2rem; padding: 0.3rem 0.55rem; cursor: pointer; font-weight: 600;
  border: 1px solid var(--lp-border); border-radius: var(--lp-radius);
  background: #fff; color: var(--lp-text);
}
.lp-rt__btn:hover { background: var(--lp-accent-subtle); color: var(--lp-accent-hover); }
.lp-rt__area { min-height: 12rem; overflow-y: auto; }
.lp-rt__area:focus {
  outline: none; border-color: var(--lp-accent);
  box-shadow: 0 0 0 0.2rem rgba(255, 0, 78, 0.18);
}
.lp-rt__area p { margin: 0 0 0.6rem; }

@media (max-width: 768px) {
  .lp-cols { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
  .lp-nav { gap: 0.85rem; width: 100%; margin-left: 0; }
  .lp-form-card { padding: 1.25rem; }
}
