/* base.css — Structural layout only. Colors & fonts come from themes.css */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Core ── */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}
body {
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-color: var(--background);
    color: var(--foreground);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; overflow-wrap: break-word; }
h1 { font-size: clamp(1.75rem, 1.5rem + 1.1vw, 2.25rem); margin: 2.5rem 0 1.5rem; }
h1:first-child { margin-block-start: 0; }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); margin: 2rem 0 1.25rem; }
p { margin-block-end: 1rem; }
p:last-child { margin-block-end: 0; }
a { color: var(--primary); text-underline-offset: 2px; }
strong { font-weight: 600; }

/* ── Layout ── */
.container { max-width: 800px; margin-inline: auto; padding-inline: 2rem; }
.hstack { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.text-center { text-align: center; }
.text-light { opacity: 0.6; }

/* ── Main & Footer ── */
.main-content { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.site-footer { padding: 2rem 0; margin-top: 3.5rem; }
.footer-theme { margin-bottom: 1rem; }
#theme-select { width: auto; min-width: 7rem; }

/* ── Back link ── */
.back-link { margin-bottom: 0.5rem; font-size: 0.875rem; }
.back-link a { text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* ── CTA card ── */
.cta-card {
    margin-bottom: 2rem;
}
.cta-link {
    display: block; padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.cta-link .description {
    display: block; font-size: 0.875rem;
    color: var(--muted-foreground); margin-top: 0.25rem;
}

/* ── Table ── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 0.5rem; text-align: start; }
th { font-weight: 500; }
.amount { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Buttons ── */
button, .button, a.button {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem;
    font-weight: 500; line-height: 1.5; white-space: nowrap;
    text-decoration: none; cursor: pointer;
    background: var(--primary); color: var(--primary-foreground);
    border: 1px solid transparent;
    border-radius: var(--radius-medium, 0.375rem);
    transition: all 0.15s ease;
}
button:hover:not(:disabled), .button:hover:not(:disabled) { opacity: 0.85; }
.small { padding: 0.25rem 0.75rem; font-size: 0.75rem; }
.outline {
    background: transparent; color: var(--foreground);
    border-color: var(--border);
}
.outline:hover { background: var(--muted); opacity: 1; }

/* ── Forms ── */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
textarea, select {
    width: 100%; padding: 0.5rem 0.75rem; font-size: inherit;
    line-height: 1.5; background: var(--background); color: var(--foreground);
    border: 1px solid var(--input, var(--border));
    border-radius: var(--radius-medium, 0.375rem);
    margin-block-start: 0.25rem;
    transition: border-color 0.12s ease;
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--ring, var(--primary));
    outline-offset: 1px;
}
input::placeholder, textarea::placeholder { opacity: 0.5; }
textarea { min-height: 5rem; resize: vertical; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.5rem center;
    padding-inline-end: 1.5rem;
}
label { display: block; font-weight: 500; margin-bottom: 1rem; }
#rows-table input, #rows-table select { margin-block-start: 0; }
#link-output { margin: 1rem 0; }
:disabled { opacity: 0.5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }

/* ── Seed list ── */
.seed-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.seed-list li { padding: 1rem 1.25rem; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease; }
.seed-list a { font-weight: 600; text-decoration: none; }
.seed-list a:hover { text-decoration: underline; }
.seed-list .description { display: block; font-size: 0.875rem; color: var(--muted-foreground); margin-top: 0.25rem; }

/* ── Recipe actions ── */
.recipe-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 2rem 0; }
.recipe-actions a { text-decoration: none; }

/* ── Nav ── */
.site-nav {
    padding: 0.75rem 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
.site-brand {
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--primary);
}
.nav-links {
    display: flex;
    gap: 1.5rem;
}
.nav-links a {
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease;
}
.nav-links a:hover {
    color: var(--primary);
}

/* ── FAQ ── */
.faq-list {
    display: grid;
    gap: 0.75rem;
    scroll-margin-top: 2rem;
}
.faq-list details {
    scroll-margin-top: 2rem;
}
.faq-list details {
    padding: 1rem 1.25rem;
}
.faq-list summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.faq-list summary::-webkit-details-marker {
    display: none;
}
.faq-list summary::before {
    content: "+";
    display: inline-block;
    width: 1.5em;
    font-weight: 700;
    color: var(--primary);
}
.faq-list details[open] > summary::before {
    content: "\2212";
}
.faq-answer {
    margin-top: 1rem;
}
.faq-answer ul,
.faq-answer ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}
.faq-answer li {
    margin-bottom: 0.25rem;
}
.faq-answer table {
    margin: 1rem 0;
}

/* ── Utility ── */
[hidden] { display: none !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .container { padding-inline: 1rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.8125rem; }

    /* Tighter vertical rhythm on mobile */
    .main-content { padding-top: 1.25rem; padding-bottom: 1.5rem; }
    h1 { margin: 1.25rem 0 0.75rem; }
    h2 { margin: 1.25rem 0 0.625rem; }
    p { margin-block-end: 0.625rem; }
    label { margin-bottom: 0.625rem; }
    .recipe-actions { margin: 1rem 0; }
    .site-footer { margin-top: 2rem; padding: 1.25rem 0; }

    /* Recipe table: compact on mobile */
    .recipe-table th, .recipe-table td { padding: 0.375rem 0.375rem; font-size: 0.8125rem; }
    .recipe-table th { font-size: 0.75rem; }

    /* Editor: compact table on mobile */
    #rows-table th, #rows-table td { padding: 0.25rem 0.125rem; font-size: 0.75rem; }
    #rows-table input { font-size: 0.75rem; padding: 0.25rem 0.25rem; width: 100%; }
    #rows-table button { padding: 0.125rem 0.375rem; font-size: 0.75rem; min-width: 0; }
}
