/* ==========================================================
   Directori de Gegants — estils
   ========================================================== */

:root {
  --paper: #f7f1e1;
  --paper-2: #efe6cf;
  --vermell: #b7282e;
  --vermell-fosc: #8f1f24;
  --blau: #1f3b57;
  --blau-2: #284a6b;
  --or: #c99a2e;
  --or-clar: #e8c765;
  --verd: #4c6b4f;
  --tinta: #241d16;
  --tinta-suau: #5a5245;

  --font-display: "Bevan", "Georgia", serif;
  --font-body: "Nunito Sans", "Segoe UI", sans-serif;

  --radius: 14px;
  --shadow-card: 0 10px 24px rgba(36, 29, 22, 0.14);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--tinta);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--vermell);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: var(--blau);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 200;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 2px;
  border-radius: 4px;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--vermell);
  color: #fff;
}

.btn-primary:hover {
  background: var(--vermell-fosc);
}

.btn-outline {
  background: transparent;
  color: var(--blau);
  border-color: var(--blau);
}

.btn-light {
  background: var(--paper);
  color: var(--vermell-fosc);
}

.section-title {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.2rem);
  color: var(--blau);
}

.section-subtitle {
  color: var(--tinta-suau);
  max-width: 60ch;
}

.status-message {
  background: var(--paper-2);
  border: 1px dashed var(--tinta-suau);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--tinta-suau);
  text-align: center;
}

/* ---------- Topbar ---------- */

.topbar {
  background: var(--blau);
  color: #fff;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.brand-mark {
  font-size: 1.4rem;
}

.topbar-yt {
  color: var(--or-clar);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 14px;
  border: 1.5px solid var(--or-clar);
  border-radius: 999px;
  white-space: nowrap;
}

.topbar-yt:hover {
  background: var(--or-clar);
  color: var(--blau);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--blau);
  color: #fff;
  padding: 64px 0 120px;
  overflow: hidden;
}

.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.6;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw + 1rem, 3.4rem);
  margin-bottom: 0.4em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #eae3d2;
  max-width: 58ch;
}

.hero-search {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin-top: 24px;
}

.hero-search input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--tinta);
}

.hero-search input::placeholder {
  color: var(--tinta-suau);
}

.hero-search button {
  padding: 13px 24px;
  border-radius: 999px;
  border: none;
  background: var(--vermell);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-body);
}

.hero-search input:disabled,
.hero-search button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hero-search-note {
  font-size: 0.9rem;
  color: #cfd9e4;
  margin-top: 8px;
}

.hero-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 24px 0 0;
}

.chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- Franja de credibilitat ---------- */

.cred-strip {
  margin-top: -70px;
  position: relative;
  z-index: 2;
}

.cred-card {
  background: var(--paper);
  border: 1px solid var(--paper-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}

.cred-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cred-number {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw + 0.8rem, 2rem);
  color: var(--vermell);
}

.cred-label {
  font-size: 0.85rem;
  color: var(--tinta-suau);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Ribbon (element de firma) ---------- */

.ribbon {
  position: relative;
  background: var(--vermell);
  color: #fff;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  border-width: 8px 10px 0 0;
  border-style: solid;
  border-color: var(--vermell-fosc) transparent transparent transparent;
}

.ribbon-poble {
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.ribbon-comarca {
  font-size: 0.78rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Vídeo destacat ---------- */

.featured {
  padding: 72px 0 24px;
}

.featured-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
}

.featured-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--tinta);
}

.featured-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.featured-info {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.featured-type {
  display: inline-block;
  align-self: flex-start;
  background: var(--or-clar);
  color: var(--tinta);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
}

.featured-info h3 {
  color: var(--blau);
  font-size: 1.5rem;
  margin-top: 4px;
}

.featured-info p {
  color: var(--tinta-suau);
}

.featured-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ---------- Més vídeos ---------- */

.more-videos {
  padding: 48px 0;
}

.mini-video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.mini-video-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.mini-video-embed {
  aspect-ratio: 16 / 9;
  background: var(--tinta);
}

.mini-video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.mini-video-info {
  padding: 14px 16px;
}

.mini-video-info h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tinta);
  margin-bottom: 6px;
}

.mini-video-info a {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.mini-video-info a:hover {
  text-decoration: underline;
}

/* ---------- Directori ---------- */

.directory {
  padding: 48px 0 72px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 24px;
}

.gegant-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.gegant-embed {
  aspect-ratio: 16 / 9;
  background: var(--tinta);
}

.gegant-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.gegant-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.gegant-body h3 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--tinta);
  margin: 0;
}

.gegant-body p {
  color: var(--tinta-suau);
  font-size: 0.92rem;
  margin: 0;
}

.gegant-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

.gegant-actions .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.gegant-card-add {
  background: var(--paper-2);
  border: 2px dashed var(--or);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 30px 20px;
  min-height: 220px;
  color: var(--tinta-suau);
}

.gegant-card-add .plus {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--or);
  line-height: 1;
}

.gegant-card-add a {
  font-weight: 700;
  text-decoration: none;
}

.gegant-card-add a:hover {
  text-decoration: underline;
}

/* ---------- Eina interna ---------- */

.internal-tool {
  padding: 48px 0 64px;
  background: var(--paper-2);
  border-top: 2px dashed var(--or);
  border-bottom: 2px dashed var(--or);
}

.tool-badge {
  display: inline-block;
  background: var(--or-clar);
  color: var(--tinta);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.tool-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 640px;
  margin-top: 12px;
}

.tool-form input {
  flex: 1;
  min-width: 240px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--tinta-suau);
  font-family: var(--font-body);
  font-size: 1rem;
}

.tool-form button {
  padding: 12px 22px;
  border-radius: 8px;
  border: none;
  background: var(--blau);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.tool-form button:hover {
  background: var(--blau-2);
}

.tool-result {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.tool-result img {
  border-radius: 8px;
  width: 168px;
  height: 94px;
  object-fit: cover;
  flex-shrink: 0;
}

.tool-result-info {
  flex: 1;
  min-width: 220px;
}

.tool-result-info label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 10px 0 6px;
  color: var(--tinta-suau);
}

.tool-result-info textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--tinta-suau);
  resize: vertical;
}

#tool-copy {
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--vermell);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

#tool-copy:hover {
  background: var(--vermell-fosc);
}

.copy-feedback {
  font-size: 0.85rem;
  color: var(--verd);
  min-height: 1.2em;
  margin: 6px 0 0;
}

.internal-tool .status-message {
  margin-top: 18px;
  max-width: 640px;
}

/* ---------- Banda de subscripció ---------- */

.subscribe-band {
  background: var(--vermell);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}

.subscribe-inner h2 {
  color: #fff;
  font-size: clamp(1.6rem, 2.5vw + 1rem, 2.3rem);
}

.subscribe-inner p {
  color: #f6dede;
  max-width: 50ch;
  margin: 0 auto 20px;
}

/* ---------- Per què aquesta web ---------- */

.why {
  padding: 64px 0;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 20px;
}

.why-item h3 {
  color: var(--blau);
  font-size: 1.15rem;
}

.why-item p {
  color: var(--tinta-suau);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--tinta);
  color: #d9d2c3;
  padding: 30px 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--or-clar);
}

.footer-note {
  color: #a89e8c;
  font-size: 0.82rem;
  margin-bottom: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .featured-card {
    grid-template-columns: 1fr;
  }

  .mini-video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .directory-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .cred-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 48px 0 130px;
  }

  .hero-search {
    flex-direction: column;
  }

  .mini-video-grid {
    grid-template-columns: 1fr;
  }

  .directory-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .tool-result {
    flex-direction: column;
  }

  .tool-result img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
