/* -----------------------------------------------------------------------------
   Post-migration tweaks requested after the pixel-perfect conversion.
   Kept in a separate file so public/css/app.css stays byte-identical to the
   original prototype.
   -------------------------------------------------------------------------- */

/* Home · "01 / What I do" — bump the skill tags up a little for legibility */
.skills-teaser-tags .tag {
  font-size: 13px;
  padding: 8px 14px;
}

/* Nav · Skills dropdown — an invisible bridge over the 14px gap between the
   "Skills" link and the menu, so the items stay reachable while hovering. */
.nav-item-dropdown:hover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 18px;
}

/* -----------------------------------------------------------------------------
   Blog index — filterable layout with a sidebar (search / category / sort),
   post images and Featured / Pinned badges.
   -------------------------------------------------------------------------- */
.blog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: start;
}

.blog-sidebar {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  position: sticky;
  top: 100px;
  background: var(--surface);
}

.blog-search { margin: 0 0 6px; }
.blog-search input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  transition: border-color .3s ease;
}
.blog-search input::placeholder { color: var(--muted); }
.blog-search input:focus { outline: none; border-color: var(--lime-dark); }

.blog-filter-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.blog-filter-group h6 {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.blog-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: background-color .25s ease, color .25s ease;
}
.blog-filter:hover { color: var(--text); }
.blog-filter.active {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.blog-filter .count {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.blog-filter.active .count {
  background: rgba(127, 127, 127, .35);
  color: var(--bg);
}

.blog-count {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
}

/* post images + badges reuse the prototype .post-card / .post-card-visual */
.post-card-visual { position: relative; overflow: hidden; }
.post-card-visual--image { font-size: 0; padding: 0; }
.post-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-featured .post-card-visual--image img { border-radius: 16px; }

.post-badge {
  position: absolute;
  top: 14px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1;
}
.post-badge--featured { left: 14px; background: var(--lime); color: #0a0a08; }
.post-badge--pinned { right: 14px; background: var(--text); color: var(--bg); }

.blog-empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.blog-empty p { margin: 0 0 16px; }

@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; gap: 32px; }
  .blog-sidebar { position: static; top: auto; }
}

/* Skills · work-grid / overview cards — optional uploaded image replaces the
   coloured visual-word block (parallels blog post card images). */
.project-visual--image {
  padding: 0;
  font-size: 0;
}
.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Blog sidebar · collapse the category list past the first 4.
   The author `.blog-filter { display:flex }` outweighs the UA
   `details:not([open]) > *` rule, so hide the extra rows explicitly. */
.blog-filter-more:not([open]) > a.blog-filter { display: none; }
.blog-filter-more > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.blog-filter-more > summary::-webkit-details-marker { display: none; }
.blog-filter-more > summary:hover { color: var(--text); }
.blog-filter-more > summary .less-label { display: none; }
.blog-filter-more[open] > summary .more-label { display: none; }
.blog-filter-more[open] > summary .less-label { display: inline; }

/* Buttons · the prototype's `.btn` has no `display`, so any `.btn` that isn't
   a flex child (the "View all posts" / "Back to all posts" links) rendered as
   an inline box — its vertical padding bled into the text above and its
   `margin-top: 40px` was silently ignored. Make every pill a block-level box;
   flex-child buttons (hero, CTA rows) are unaffected. */
.btn { display: inline-block; }

/* Contact form · phone field with country-code picker (added post-migration).
   The prototype form had a single email field; this splits contact into
   email + phone, the phone prefix auto-set from the visitor's timezone. */
.phone-input {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .3s ease;
}
.phone-input:focus-within { border-color: var(--lime-dark); }
.phone-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line);
}
.phone-dial {
  padding: 14px 12px 14px 16px;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
}
.phone-dial::after {
  content: "\25BE";
  margin-left: 7px;
  font-size: 10px;
  vertical-align: middle;
}
.phone-country {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-family: "DM Sans", sans-serif;
}
.phone-input input[type="tel"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
}
.phone-input input[type="tel"]:focus { outline: none; border: 0; }

/* Contact form · submission feedback (success / validation errors). The form
   posts to the server now, so it needs a visible confirmation on return. */
.form-note {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
}
.form-note--ok {
  border-color: var(--lime);
  background: color-mix(in srgb, var(--lime) 12%, var(--surface));
}
.form-note--error {
  border-color: color-mix(in srgb, #e5484d 60%, var(--line));
  background: color-mix(in srgb, #e5484d 8%, var(--surface));
}
.form-note ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.form-note li { margin-top: 2px; }

/* -----------------------------------------------------------------------------
   Mobile navigation menu (the prototype hides .nav-links below 800px with no
   replacement). Desktop is untouched — everything here is inside the media query
   or hidden by default.
   -------------------------------------------------------------------------- */
.nav-toggle { display: none; }

@media (max-width: 800px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--nav-cta-border);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s ease, opacity .2s ease;
  }
  nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    padding: 14px 20px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  nav.nav-open .nav-links > a,
  nav.nav-open .nav-item-dropdown > a {
    display: block;
    width: 100%;
    padding: 12px 4px;
    font-size: 16px;
    opacity: 1;
  }
  nav.nav-open .nav-item-dropdown { position: static; width: 100%; }
  nav.nav-open .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    min-width: 0;
    padding: 0 0 6px 14px;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  nav.nav-open .dropdown-menu a { padding: 9px 4px; font-size: 14px; opacity: .8; }
}
