/**
 * Base Styles - Reset & Typography
 * Procedure Amministrative Theme
 */

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

/* Remove default margins */
* {
    margin: 0;
    padding: 0;
}

/* HTML & Body */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

/* Display font */
.font-display {
    font-family: var(--font-display);
}

/* Paragraphs */
p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
}

li:last-child {
    margin-bottom: 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Figures */
figure {
    margin: 0 0 var(--space-4);
}

figcaption {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-top: var(--space-2);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-4);
    margin: var(--space-6) 0;
    font-style: italic;
    color: var(--color-text-light);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background-color: var(--color-bg-alt);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

pre {
    background-color: var(--color-bg-dark);
    color: #fff;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-4);
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: var(--font-bold);
    background-color: var(--color-bg-alt);
}

/* Forms */
input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 78, 0.15);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-8) 0;
}

/* Selection */
::selection {
    background-color: var(--color-primary);
    color: #fff;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--color-accent);
    color: #fff;
    padding: var(--space-3) var(--space-4);
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   INP Optimizations
   ========================================================================== */

/* Content visibility for below-the-fold content */
.site-footer,
.cta-block,
.section:not(:first-of-type) {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}

/* Contain layout recalculations */
.card,
.faq-item,
.infobox {
    contain: layout style;
}

/* Optimize touch targets for mobile (48px minimum per Google guidelines) */
@media (pointer: coarse) {
    .btn,
    .nav-menu .sub-menu a,
    .faq-question,
    .search-field,
    .search-submit,
    .pagination a {
        min-height: 48px;
    }

    .breadcrumbs-link,
    .post-tags a {
        padding-top: var(--space-2);
        padding-bottom: var(--space-2);
    }
}
