/* ==========================================================================
   Utilix — Inner Pages (tool, category, blog, search)
   ========================================================================== */

.page-hero .icon-circle--category { margin-bottom: 16px; }

.page-hero__inner .icon-circle--category + h1 { margin-top: 4px; }

.page-hero {
    padding: 48px 0 40px;
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    border-bottom: 1px solid var(--border);
}

.page-hero--compact { padding: 32px 0 28px; }

.page-hero__inner { max-width: 800px; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.breadcrumb li { display: flex; align-items: center; gap: 8px; color: var(--text-light); }
.breadcrumb li:not(:last-child)::after { content: '/'; color: var(--border); }
.breadcrumb a { color: var(--text); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb li[aria-current="page"] { color: var(--heading); font-weight: 500; }

.page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--heading);
    line-height: 1.15;
}

.page-hero__desc {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text);
}

.page-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-light);
}

.page-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.page-hero__meta svg, .page-hero__meta [data-lucide] { width: 16px; height: 16px; }

/* Page content */
.page-content { padding: 48px 0 80px; }
.page-content--narrow .container { max-width: 900px; }

/* Tool listing grid (category, search) */
.tool-grid--listing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-grid--listing .tool-card {
    padding: 24px;
}

/* Tool detail */
.tool-page { padding: 48px 0 80px; }

.tool-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tool-panel__header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

.tool-panel__header h1 {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--heading);
}

.tool-panel__summary {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.tool-panel__body { padding: 32px; }

.tool-panel__footer {
    padding: 24px 32px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-section);
}

/* Forms */
.tool-form label,
.form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--heading);
}

.tool-form input,
.tool-form textarea,
.tool-form select,
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--heading);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.tool-form input:focus,
.tool-form textarea:focus,
.tool-form select:focus,
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tool-form textarea { min-height: 160px; resize: vertical; font-family: 'Consolas', 'Monaco', monospace; font-size: 0.875rem; }

.tool-form button[type="submit"],
.form-field button[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.tool-form button[type="submit"]:hover,
.form-field button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tool-result {
    margin-top: 24px;
    padding: 20px;
    background: #0F172A;
    color: #E2E8F0;
    border-radius: var(--radius-md);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.tool-result[hidden] { display: none; }

.tool-description {
    margin-top: 32px;
    padding: 28px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--text);
}

.tool-description h2, .tool-description h3 { color: var(--heading); margin-top: 1.5em; }
.tool-description p { margin: 0 0 1em; }

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    border-color: #93C5FD;
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.blog-card__thumb {
    display: block;
    height: 160px;
    position: relative;
    overflow: hidden;
}

.blog-card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }

.blog-card__date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
}

.blog-card h2 {
    margin: 0 0 10px;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.4;
}

.blog-card h2 a { color: var(--heading); transition: color var(--transition); }
.blog-card h2 a:hover { color: var(--primary); }

.blog-card p {
    margin: 0 0 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    flex: 1;
}

/* Blog article */
.article-page { padding: 48px 0 80px; }

.article-panel {
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.article-panel__header {
    padding: 40px 40px 32px;
    border-bottom: 1px solid var(--border);
}

.article-panel__header h1 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--heading);
    line-height: 1.2;
}

.article-panel__date {
    font-size: 0.875rem;
    color: var(--text-light);
}

.article-panel__content {
    padding: 32px 40px 40px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
}

.article-panel__content h2, .article-panel__content h3 { color: var(--heading); margin: 1.5em 0 0.5em; }
.article-panel__content p { margin: 0 0 1.25em; }
.article-panel__content ul, .article-panel__content ol { margin: 0 0 1.25em; padding-left: 1.5em; }
.article-panel__content a { color: var(--primary); text-decoration: underline; }
.article-panel__content img { max-width: 100%; border-radius: var(--radius-md); margin: 1em 0; }

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.article-back:hover { gap: 10px; }

/* Search */
.search-hero-form {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    max-width: 560px;
}

.search-hero-form input {
    flex: 1;
    padding: 14px 20px;
    font-family: var(--font);
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-hero-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Pagination */
.pagination,
.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span,
.pager a,
.pager span,
.pager li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all var(--transition);
    list-style: none;
}

.pagination a:hover,
.pager a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #EFF6FF;
}

.pagination .active a,
.pagination .active span,
.pager .active a {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pager ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Empty / notice */
.notice-box {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-section);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.notice-box__icon {
    margin: 0 auto 16px;
}

.notice-box h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--heading);
}

.notice-box p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text);
}

.notice-box a { color: var(--primary); font-weight: 600; }

/* Error page */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

.error-card {
    text-align: center;
    max-width: 480px;
    padding: 48px 40px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.error-card__code {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
}

.error-card h1 {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading);
}

.error-card p {
    margin: 0 0 28px;
    color: var(--text);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .tool-grid--listing { grid-template-columns: repeat(2, 1fr); }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .page-hero { padding: 32px 0 28px; }
    .page-content { padding: 32px 0 56px; }
    .tool-grid--listing { grid-template-columns: 1fr; }
    .blog-grid { grid-template-columns: 1fr; }
    .tool-panel__header, .tool-panel__body, .tool-panel__footer { padding: 24px; }
    .article-panel__header, .article-panel__content { padding: 24px; }
    .search-hero-form { flex-direction: column; }
    .search-hero-form .btn { width: 100%; }
}
