/* =========================================================
   steipete.me — recreated styles
   Personal site of @steipete (Peter Steinberger)
   Built with Astro + Tailwind, recreated as plain CSS.
   ========================================================= */

/* ---------- 1. Design tokens (theme) ---------- */
:root {
  --font-sans: ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --color-bg: #ffffff;
  --color-bg-subtle: #f9fafb;        /* slate-50 */
  --color-bg-muted: #f3f4f6;         /* gray-100 */
  --color-border: #e5e7eb;           /* gray-200 */
  --color-border-strong: #d1d5db;    /* gray-300 */
  --color-text: #111827;             /* gray-900 */
  --color-text-muted: #4b5563;       /* gray-600 */
  --color-text-subtle: #6b7280;      /* gray-500 */
  --color-link: #2563eb;             /* blue-600 */
  --color-link-hover: #1d4ed8;       /* blue-700 */
  --color-accent: #111827;

  --container: 48rem;                /* max-w-3xl */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
               0 2px 4px -2px rgb(0 0 0 / 0.1);

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 2. Base / reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--color-border);
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.75;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

h1 { font-size: 2.25rem; }   /* text-4xl */
h2 { font-size: 1.875rem; }  /* text-3xl */
h3 { font-size: 1.5rem; }    /* text-2xl */
h4 { font-size: 1.25rem; }   /* text-xl */

p { margin: 0; }

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-link-hover); text-decoration: underline; }

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

::selection { background: #fde68a; color: #111827; }

/* ---------- 3. Accessibility helpers ---------- */
.astro-route-announcer,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- 4. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* ---------- 5. Site header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1rem;
  position: relative;
}

.nav-menu {
  order: 2;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.nav-brand:hover { text-decoration: none; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-text);
  text-decoration: none;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-text-muted);
}
.nav-icon svg { width: 1.1rem; height: 1.1rem; }

/* ---------- 6. Hero / intro section ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 3rem 0 2rem;
}

.avatar {
  width: 6rem;
  height: 6rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-bg);
}

.hero-title {
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero-title a { color: inherit; }
.hero-title a:hover { text-decoration: none; }

.hero-tagline {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---------- 7. Social icon row ---------- */
.social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.25rem;
  font-size: 0.875rem;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}
.social-row a:hover { color: var(--color-text); text-decoration: none; }
.social-row a svg { width: 1rem; height: 1rem; }

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
.btn-primary:hover { background: #1f2937; color: var(--color-bg); }

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-outline:hover { background: var(--color-bg-muted); color: var(--color-text); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-bg-muted); }

/* ---------- 9. Post list (homepage cards) ---------- */
.posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.post-card:first-child { padding-top: 0.5rem; }
.post-card:last-child  { border-bottom: 0; }

.post-thumb {
  flex-shrink: 0;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: 0.75rem;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-body { flex: 1 1 auto; min-width: 0; }

.post-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.post-title a {
  color: var(--color-text);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--transition);
}
.post-title a:hover {
  text-decoration: none;
  color: var(--color-link);
  background-size: 100% 1px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  margin-bottom: 0.4rem;
}
.post-meta .dot { color: var(--color-border-strong); }

.post-excerpt {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 10. Section headings ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2.5rem 0 1rem;
}
.section-head h2 { font-size: 1.25rem; font-weight: 600; }

.see-all {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.see-all:hover { color: var(--color-link); }

/* ---------- 11. Article (single post) ---------- */
.article {
  padding: 3rem 0 4rem;
}

.article-header {
  margin-bottom: 2.5rem;
}
.article-header .post-meta { margin-bottom: 0.75rem; }
.article-title {
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.article-excerpt {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 42rem;
}

.prose {
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text);
}
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 1.5rem; margin-top: 2.5em; margin-bottom: 0.75em; }
.prose h3 { font-size: 1.25rem; margin-top: 2em;  margin-bottom: 0.5em; }
.prose h4 { font-size: 1.125rem; margin-top: 1.75em; margin-bottom: 0.5em; }
.prose p  { color: var(--color-text); }
.prose a  { color: var(--color-link); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--color-link-hover); }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose strong { font-weight: 600; color: var(--color-text); }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--color-border-strong);
  padding-left: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}
.prose pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: #0b1020;
  color: #e5e7eb;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.prose img {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-block: 1.5em;
}
.prose hr { margin: 2.5em 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.5em 0.75em;
  border-bottom: 1px solid var(--color-border);
}
.prose th { font-weight: 600; }

/* ---------- 12. Tag pill ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.tag:hover { background: var(--color-text); color: var(--color-bg); }

/* ---------- 13. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0 3rem;
  margin-top: 4rem;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
}
.site-footer .social-row { justify-content: center; margin-bottom: 1rem; }
.site-footer .copyright { text-align: center; }
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-text); }

/* ---------- 14. Pagination ---------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.pagination a:hover { color: var(--color-link); text-decoration: none; }

/* ---------- 15. About page ---------- */
.about {
  padding: 3rem 0;
}
.about p + p { margin-top: 1rem; }

/* ---------- 16. Search page ---------- */
.search-form { display: flex; gap: 0.5rem; margin: 2rem 0; }
.search-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
}
.search-input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--color-text);
  box-shadow: 0 0 0 3px rgb(17 24 39 / 0.1);
}

/* ---------- 17. Utility classes (Tailwind parity) ---------- */
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mt-8  { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.mx-auto { margin-inline: auto; }

.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
.text-lg    { font-size: 1.125rem; }
.text-xl    { font-size: 1.25rem; }
.text-muted { color: var(--color-text-muted); }
.text-subtle{ color: var(--color-text-subtle); }
.font-medium{ font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex      { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-b { border-bottom: 1px solid var(--color-border); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: var(--container); }
.mx-auto { margin-inline: auto; }
.px-6   { padding-inline: 1.5rem; }
.py-2   { padding-block: 0.5rem; }
.py-4   { padding-block: 1rem; }

/* ---------- 18. Responsive tweaks ---------- */
@media (min-width: 640px) {
  .hero { flex-direction: row; align-items: center; gap: 1.75rem; }
  .hero-title { font-size: 2.5rem; }
}

/* Breakpoint móvil: ocultar menú desktop, mostrar hamburger */
@media (max-width: 720px) {
  .nav { gap: 0.5rem; }
  .nav-menu { display: none; }
  .nav-brand { font-size: 1rem; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { flex: 0 0 auto; margin-left: 0; }
  .nav-menu { order: 0; }
}

@media (max-width: 480px) {
  .nav-brand { font-size: 0.95rem; }
  .article-title { font-size: 1.875rem; }
  .post-card { gap: 0.75rem; }
  .post-thumb { width: 4.5rem; height: 4.5rem; }
  .mobile-nav { width: min(92vw, 360px); }
}

/* ---------- 19. Dark mode (opt-in) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b0f17;
    --color-bg-subtle: #0f1420;
    --color-bg-muted: #1a2030;
    --color-border: #1f2638;
    --color-border-strong: #2a324a;
    --color-text: #e6e9ef;
    --color-text-muted: #a4adbf;
    --color-text-subtle: #7c8597;
    --color-link: #7aa2ff;
    --color-link-hover: #a3bfff;
  }
  .site-header { background: rgba(11, 15, 23, 0.8); }
  .prose code { background: #1a2030; }
  ::selection { background: #3b3f55; color: #fff; }
}

/* ---------- 19b. Page-scoped overrides ---------- */
.page-home ul.posts { display: none; }

/* ---------- 19c. YouTube video embed ---------- */
.video-embed {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-muted);
}

.video-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-caption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  margin: 0;
}

.video-caption a {
  color: var(--color-link);
  font-weight: 500;
}

/* ---------- 19d. Mobile nav (hamburger + off-canvas drawer) ----------
   Mobile-first: toggle siempre visible. Se oculta en pantallas >720px. */
.nav-toggle {
  order: 3;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition), border-color var(--transition);
}

/* En desktop, ocultar el toggle */
@media (min-width: 721px) {
  .nav-toggle { display: none; }
}

.nav-toggle:hover { background: var(--color-bg-muted); border-color: var(--color-border-strong); }

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 200ms ease;
}
.mobile-nav-overlay.is-active { opacity: 1; }

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 360px);
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  box-shadow: -10px 0 30px rgb(0 0 0 / 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  overscroll-behavior: contain;
}
.mobile-nav.is-open { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition);
}
.mobile-nav-close:hover { background: var(--color-bg-muted); }

.mobile-nav-menu {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 0.95rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition), color var(--transition);
  min-height: 48px;
}
.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  background: var(--color-bg-muted);
  color: var(--color-link);
  text-decoration: none;
  outline: none;
}
.mobile-nav-link[aria-current="page"] {
  color: var(--color-link);
  font-weight: 600;
  background: var(--color-bg-muted);
  border-left: 3px solid var(--color-link);
  padding-left: calc(1.25rem - 3px);
}

.mobile-nav-footer {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  gap: 0;
}
.mobile-nav-footer .mobile-nav-link {
  border-bottom: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding: 0.6rem 0;
  min-height: 0;
}
.mobile-nav-footer .mobile-nav-link:first-child { padding-top: 0; }
.mobile-nav-footer .mobile-nav-link:last-child  { padding-bottom: 0; }

/* Lock scroll del body cuando el menú está abierto */
body.mobile-nav-open { overflow: hidden; }

/* ---------- 20. Print ---------- */
@media print {
  .site-header, .site-footer, .nav, .pagination { display: none; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
