/* Small overrides that Tailwind utility classes don't cover cleanly. */

::selection {
    background-color: #4f46e5;
    color: #ffffff;
}

html {
    scroll-behavior: smooth;
}

/* Compensate for the sticky header when jumping to an in-page anchor
   (e.g. the "skip to content" link) so the target isn't hidden underneath it. */
#main-content {
    scroll-margin-top: 4.5rem;
}

[x-cloak] {
    display: none !important;
}

/* Consistent focus ring for elements that don't already have their own Tailwind
   focus treatment (links, plain buttons). Text inputs/textareas/native selects
   use focus:border-primary + focus:ring-1 utilities instead — adding this outline
   on top of those would stack three focus indicators (border + ring + outline)
   and read as a duplicated border. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.custom-select-trigger:focus-visible {
    outline: none !important;
}

/* Native <select> styled to match the site's input fields, with a custom chevron
   since appearance can't be themed via utility classes alone.
   Specificity is boosted (html select, plus an !important on appearance) because
   the Tailwind CDN build injects its generated stylesheet at runtime and can end
   up later in the cascade than this file, which would otherwise let its defaults
   win on equal-specificity selectors regardless of link order in <head>. */
html select,
html body select,
select.select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.1em !important;
    padding-right: 2.5rem !important;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: #4f46e5;
    width: 1.05rem;
    height: 1.05rem;
}

input[type="color"] {
    padding: 0.25rem;
    cursor: pointer;
}

input[type="file"] {
    font-size: 0.875rem;
    color: #475569;
}

input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-weight: 500;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
    background: #f1f5f9;
}

/* Gentle floating animation for the homepage hero's stacked cards. Rotation is
   read from --float-rotate (set inline per-card via a Tailwind rotate class'
   equivalent degree value) since a CSS animation's transform replaces rather
   than composes with utility-class transforms. */
@keyframes hero-float {
    0%, 100% { transform: translateY(0) rotate(var(--float-rotate, 0deg)); }
    50% { transform: translateY(-14px) rotate(var(--float-rotate, 0deg)); }
}

.hero-float {
    animation: hero-float 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .hero-float {
        animation: none;
    }
}

/* Shared hover-lift used consistently on cards site-wide instead of ad hoc shadow classes per template. */
.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.06);
}

.prose {
    --tw-prose-body: #475569;
    --tw-prose-headings: #0f172a;
    --tw-prose-links: #4f46e5;
    --tw-prose-bold: #0f172a;
}

.prose img {
    border-radius: 0.75rem;
}

.prose a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media print {
    header, footer, #back-to-top {
        display: none !important;
    }
}
