/* Casa Mia – Descărcări
   Location: web/assets/css/style.css
   Change the brand look in :root only. */

:root {
  --text: #1d1d1b;
  --muted: #6e6e6a;
  --line: #e4e2de;
  --bg: #ffffff;
  --surface: #f5f4f1;
  --surface-hover: #ebe9e4;
  --accent: #1d1d1b;
  --accent-contrast: #ffffff;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 96px;
}

/* ---------- Sub-navigation ---------- */
.subnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.subnav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.subnav a {
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.subnav a:hover { color: var(--text); }
.subnav a.is-active { color: var(--text); border-bottom-color: var(--accent); }
.subnav__home { font-weight: 600; color: var(--text) !important; }

/* ---------- Page heading ---------- */
.page-head { padding: 48px 0 40px; max-width: 720px; }
.page-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.page-head__intro {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Category cards (/downloads) ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.cat-card:hover { background: var(--surface-hover); transform: translateY(-2px); }
.cat-card__title { font-size: 24px; font-weight: 600; }
.cat-card__desc { font-size: 15px; line-height: 1.55; color: var(--muted); flex: 1; }
.cat-card__cta {
  align-self: flex-start;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- Document list (/downloads/documents) ---------- */
.doc-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .2s;
}
.doc:hover { background: var(--surface-hover); }
.doc:focus-visible, .cat-card:focus-visible, .subnav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.doc__icon {
  flex: 0 0 48px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.doc__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.doc__title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.doc__meta { font-size: 13px; color: var(--muted); }
.doc__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: var(--radius);
}

/* ---------- Empty category ---------- */
.empty {
  padding: 48px 32px;
  background: var(--surface);
  border-radius: var(--radius);
  text-align: center;
}
.empty__title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.empty__text { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.empty__link {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

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

.subnav__track { position: relative; min-width: 0; }
.subnav__more { display: none; }

/* Mobile tabs: same text tabs as desktop, in a swipeable row.
   Edge fade + a thin position line make it clear the row continues. */
@media (max-width: 640px) {
  .subnav {
    display: block;
    padding: 18px 0 0;
    border-bottom: 0;
  }
  .subnav__home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    padding-bottom: 0;
    border-bottom: 0 !important;
  }
  .subnav__home:not(.is-active)::before {
    content: "";
    width: 6px;
    height: 6px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
  }

  .subnav__track { width: calc(100% + 32px); margin: 0 -16px; }
  .subnav .subnav__list {
    flex-wrap: nowrap;
    gap: 28px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* fade the side(s) where more tabs continue */
    --fade-l: 0px;
    --fade-r: 0px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  }
  .subnav__list::-webkit-scrollbar { display: none; }
  .subnav__track.is-scrollable:not(.at-end) .subnav__list   { --fade-r: 72px; }
  .subnav__track.is-scrollable:not(.at-start) .subnav__list { --fade-l: 56px; }

  .subnav__list li { flex: 0 0 auto; scroll-snap-align: start; }
  .subnav__list li:last-child { padding-right: 16px; }
  .subnav__list a {
    display: block;
    padding: 12px 0 14px;
    font-size: 16px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .subnav__list a.is-active { font-weight: 600; }

  .subnav .subnav__list a.is-active { color: var(--text); border-bottom-color: var(--accent); }

  /* hairline under the row, like desktop */
  .subnav__track::after {
    content: "";
    position: absolute;
    left: 16px; right: 16px; bottom: 0;
    height: 1px;
    background: var(--line);
    pointer-events: none;
  }

  /* minimal chevrons resting in the faded edges */
  .subnav__more {
    display: grid;
    place-items: center;
    position: absolute;
    top: 0;
    bottom: 2px;
    width: 64px;
    padding: 0 14px;
    color: var(--text);
    border: 0;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .subnav__more--prev { left: 0;  justify-items: start; background: linear-gradient(to right, var(--bg) 55%, rgba(255,255,255,0)); }
  .subnav__more--next { right: 0; justify-items: end;   background: linear-gradient(to left,  var(--bg) 55%, rgba(255,255,255,0)); }
  .subnav__track.is-scrollable:not(.at-start) .subnav__more--prev,
  .subnav__track.is-scrollable:not(.at-end)   .subnav__more--next { opacity: 1; pointer-events: auto; }
  .subnav__track.is-scrollable:not(.at-end) .subnav__more--next svg { animation: cm-hint 2.4s ease-in-out .8s 2; }
}

@keyframes cm-hint {
  0%, 60%, 100% { transform: translateX(0); }
  30%           { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .subnav__list a, .subnav__more, .subnav__more svg { transition: none !important; animation: none !important; }
}

@media (max-width: 900px) {
  .doc-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page-head { padding: 32px 0 28px; }
  .empty { padding: 32px 20px; }
  .cat-card { min-height: 0; padding: 24px; }
  .doc { flex-wrap: wrap; gap: 16px; padding: 20px; }
  .doc__icon { flex-basis: 40px; height: 48px; }
  .doc__cta { width: 100%; justify-content: center; }
}
