:root {
    --page-bg: #f4f7fc;
    --surface: #ffffff;
    --surface-soft: #f9fbff;
    --hero-bg: #07234a;
    --hero-bg-2: #0d3a73;
    --hero-dot: rgba(95, 164, 255, 0.16);
    --text: #112b52;
    --muted: #5f7191;
    --line: #d8e2f1;
    --primary: #1677f0;
    --primary-dark: #0e5fcc;
    --success: #19b34a;
    --success-dark: #11923a;
    --danger: #c74a4a;
    --shadow: 0 16px 40px rgba(25, 56, 106, 0.14);
    --shadow-soft: 0 10px 26px rgba(25, 56, 106, 0.1);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7faff 0%, #edf3fb 100%);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header,
.site-footer {
    color: #eef6ff;
    background:
        radial-gradient(circle at 20px 20px, var(--hero-dot) 1px, transparent 1px),
        linear-gradient(135deg, #061b3a 0%, #0b2f61 60%, #0a2852 100%);
    background-size: 16px 16px, auto;
}

.header-inner,
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-inner {
    padding: 18px 0;
}

.footer-inner {
    padding: 24px 0 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    font-weight: 900;
    font-size: 3rem;
    line-height: 1;
    letter-spacing: -0.06em;
}

.brand-io {
    color: #ffffff;
}

.brand-7 {
    color: #27a0ff;
    margin-left: 4px;
}

.top-nav,
.footer-nav,
.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-nav {
    flex-wrap: wrap;
}

.top-nav a,
.footer-nav a {
    font-weight: 600;
    color: rgba(238, 246, 255, 0.92);
}

.top-nav a:hover,
.footer-nav a:hover {
    color: #ffffff;
}

.nav-admin {
    padding: 10px 18px;
    border: 1px solid rgba(184, 216, 255, 0.34);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.page-main {
    flex: 1;
    padding: 0 0 42px;
}

.home-page .page-main > .container {
    width: min(1240px, 100%);
}

.home-page .site-header {
    position: relative;
    z-index: 5;
}

.hero-panel {
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: center;
    justify-items: center;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 46px max(16px, calc((100vw - 1180px) / 2)) 60px;
    margin-top: -1px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(6, 27, 58, 0.82) 0%, rgba(11, 47, 97, 0.78) 60%, rgba(10, 40, 82, 0.82) 100%),
        url('../img/heroarka.jpg') center/cover no-repeat;
    background-size: auto, cover;
}

.hero-panel-copy {
    justify-self: center;
    max-width: 820px;
    padding-right: 0;
    text-align: center;
}

.hero-panel-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(2.6rem, 4.8vw, 4.2rem);
    line-height: 1.08;
    color: #ffffff;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    margin: 0;
    color: rgba(236, 245, 255, 0.92);
    font-size: clamp(1.05rem, 1.9vw, 1.55rem);
    font-weight: 500;
}

.hero-panel p,
.panel-card p,
.blog-card p,
.content-card p,
.learning-card p,
.article-card p {
    color: var(--muted);
}

.hero-panel p {
    max-width: 720px;
    color: rgba(236, 245, 255, 0.86);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 26px 0 20px;
}

.hero-cta {
    min-width: 190px;
    min-height: 54px;
    font-size: 1.05rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 24px;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.button-primary {
    background: linear-gradient(180deg, #2f92ff 0%, #166fe3 100%);
}

.button-primary:hover {
    background: linear-gradient(180deg, #2587f4 0%, #1266d3 100%);
}

.button-success {
    background: linear-gradient(180deg, #24c255 0%, #17a947 100%);
}

.button-success:hover {
    background: linear-gradient(180deg, #20b550 0%, #149a40 100%);
}

.button-secondary {
    background: #eaf1fb;
    color: var(--text);
}

.button-danger {
    background: var(--danger);
}

.hero-search {
    position: relative;
    width: min(100%, 560px);
    margin: 0 auto;
}

.hero-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #213a66;
    font-size: 1.35rem;
    line-height: 1;
}

.hero-search input {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 8px;
    padding: 0 20px 0 52px;
    font: inherit;
    color: var(--text);
    box-shadow: 0 12px 26px rgba(5, 20, 48, 0.22);
}

.home-section {
    width: min(1060px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}

.section-title-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.section-title-row h2,
.panel-card h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    color: #15376e;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(147, 172, 207, 0.45), rgba(147, 172, 207, 0.04));
}

.featured-tool-row,
.card-grid,
.blog-list,
.stats-grid,
.admin-links,
.admin-layout {
    display: grid;
    gap: 18px;
}

.featured-tool-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.featured-tool-card,
.category-card,
.learning-card,
.article-card,
.empty-card,
.auth-card,
.panel-card,
.stat-card,
.admin-link-card,
.content-card,
.blog-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 225, 242, 0.9);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.featured-tool-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
}

.featured-tool-icon,
.category-icon-wrap {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(145deg, #f6faff 0%, #eaf1fb 100%);
}

.featured-tool-icon {
    width: 54px;
    height: 54px;
}

.featured-tool-icon img,
.category-icon-wrap img,
.learning-thumb,
.article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-grid,
.learn-grid,
.article-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.category-card,
.learning-card,
.article-card,
.auth-card,
.panel-card,
.admin-link-card,
.stat-card,
.blog-card,
.content-card,
.empty-card {
    padding: 18px;
}

.category-icon-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: 14px;
}

.category-card h3,
.learning-card h3,
.article-card h3,
.content-card h3,
.blog-card h3 {
    margin: 0 0 8px;
    color: #173c73;
}

.category-card p,
.learning-card p,
.article-date,
.blog-meta,
.blog-content-preview {
    color: var(--muted);
}

.learning-thumb,
.article-image {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    margin-bottom: 14px;
    background: linear-gradient(145deg, #dcebff 0%, #eef5ff 100%);
}

.learning-placeholder,
.article-placeholder {
    background: linear-gradient(145deg, #dcebff 0%, #eef5ff 100%);
}

.article-body {
    padding-top: 4px;
}

.section-action {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.view-posts {
    min-width: 180px;
}

.auth-section {
    padding: 40px 0;
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.form-grid label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.form-grid input,
.form-grid textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--surface);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stats-grid,
.admin-links {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 24px;
}

.admin-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.admin-profile-layout {
    align-items: start;
}

.admin-list {
    display: grid;
    gap: 14px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.admin-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.alert {
    margin: 20px auto 0;
    width: min(1180px, calc(100% - 32px));
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
}

.alert-success {
    background: #dff3e5;
    color: #1f6937;
}

.alert-error {
    background: #f9dddd;
    color: #8b2323;
}

.footer-extended {
    flex-direction: column;
    align-items: stretch;
}

.footer-brand-row {
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-logo {
    font-size: 2.6rem;
}

.footer-divider {
    flex: 1;
    min-width: 40px;
    height: 1px;
    background: rgba(185, 216, 255, 0.24);
}

.footer-copy {
    margin: 0;
    color: rgba(238, 246, 255, 0.74);
}

@media (max-width: 980px) {
    .hero-panel {
        padding: 36px 16px 48px;
    }

    .hero-panel-copy {
        max-width: 100%;
        justify-self: stretch;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .hero-panel {
        gap: 18px;
    }

    .hero-panel-copy {
        max-width: 100%;
        text-align: center;
    }

    .hero-search {
        max-width: 100%;
    }

    .header-inner,
    .footer-brand-row,
    .admin-header,
    .admin-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-logo {
        font-size: 2.5rem;
    }

    .auth-card h1,
    .admin-header h1 {
        font-size: 2.3rem;
    }

    .hero-actions {
        width: 100%;
    }

    .button {
        width: 100%;
    }

    .top-nav,
    .footer-nav {
        gap: 12px;
    }

    .featured-tool-card {
        grid-template-columns: 48px 1fr;
    }

    .admin-header-actions {
        width: 100%;
    }
}

.admin-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.current-image-box {
    display: grid;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}

.current-image-box img {
    width: 100%;
    max-width: 220px;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.admin-tool-item {
    align-items: flex-start;
}

.search-page-section {
    width: min(1060px, calc(100% - 32px));
    margin: 36px auto 0;
    display: grid;
    gap: 22px;
}

.search-page-header h1 {
    margin: 8px 0 14px;
    color: #15376e;
    font-size: clamp(2rem, 4vw, 3rem);
}

.search-eyebrow {
    color: #3a7ad9;
}

.search-page-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-page-form input {
    flex: 1;
    min-width: 240px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    background: var(--surface);
}

.search-summary {
    margin: 14px 0 0;
    color: var(--muted);
}

.search-results-grid {
    display: grid;
    gap: 18px;
}

.search-result-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 225, 242, 0.9);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.search-result-link {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: stretch;
}

.search-result-media {
    background: linear-gradient(145deg, #f6faff 0%, #eaf1fb 100%);
}

.search-result-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-body {
    padding: 18px 18px 18px 0;
}

.search-result-body h2 {
    margin: 8px 0 10px;
    color: #173c73;
}

.search-result-body p,
.search-result-address {
    color: var(--muted);
}

.search-result-category {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf5ff;
    color: #2d68c4;
    font-size: 0.9rem;
    font-weight: 700;
}

.search-result-address {
    display: block;
    margin-top: 12px;
    font-size: 0.92rem;
}

.popular-searches-panel {
    margin-top: 24px;
}

.popular-search-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.popular-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.popular-search-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-search-item p {
    margin: 6px 0 0;
}

.popular-search-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #edf5ff;
    color: #245cb3;
    font-weight: 700;
}

@media (max-width: 720px) {
    .search-result-link {
        grid-template-columns: 1fr;
    }

    .search-result-body {
        padding: 0 18px 18px;
    }

    .popular-search-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.usage-box {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
}

.usage-box strong,
.search-result-usage {
    color: #2b66c2;
    font-weight: 700;
}

.search-result-usage {
    display: inline-block;
    margin-top: 12px;
}

.profile-summary-list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.profile-summary-list span {
    display: inline-block;
    margin-bottom: 8px;
    color: #5a74a0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-summary-list strong,
.profile-summary-list p {
    margin: 0;
    color: var(--text);
}

.profile-summary-list p {
    white-space: pre-wrap;
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.learning-card,
.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.blog-card-copy,
.article-body {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.learning-card h3,
.article-card h3,
.learning-card p,
.article-excerpt {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.learning-card p,
.article-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.learning-card p {
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.article-excerpt {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.blog-card-link:hover h3 {
    color: #125fc2;
}

.blog-detail-section {
    padding-top: 36px;
}

.blog-detail-card {
    max-width: 860px;
    margin: 0 auto;
}

.blog-detail-card h1 {
    margin: 10px 0 18px;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #15376e;
}

.blog-detail-back {
    display: inline-flex;
    margin-bottom: 18px;
    color: #2466c1;
    font-weight: 700;
}

.blog-detail-image {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 18px;
}

.blog-detail-excerpt {
    margin: 0 0 18px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #466487;
}

.blog-detail-content {
    color: var(--text);
    line-height: 1.8;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.learn-grid,
.article-grid {
    align-items: stretch;
}

.learning-card,
.article-card,
.blog-card-link,
.blog-card-copy,
.article-body {
    min-width: 0;
    max-width: 100%;
}

.learning-card,
.article-card {
    border-radius: 14px;
}

.learning-thumb,
.article-image,
.learning-placeholder,
.article-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    overflow: hidden;
}

.blog-card-copy {
    padding-top: 2px;
}

.learning-card h3,
.article-card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
    max-height: 2.7em;
}

.learning-card p,
.article-excerpt {
    line-height: 1.6;
    max-height: 6.4em;
}

.article-excerpt {
    max-height: 4.8em;
}

.blog-teaser-card {
    padding: 0;
    overflow: hidden;
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.blog-card-media {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(145deg, #dcebff 0%, #eef5ff 100%);
}

.blog-card-content {
    display: grid;
    gap: 10px;
    padding: 18px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.96);
}

.learning-card .learning-thumb,
.article-card .article-image,
.learning-card .learning-placeholder,
.article-card .article-placeholder {
    margin-bottom: 0;
    border-radius: 0;
}

.learning-card h3,
.article-card h3,
.learning-card p,
.article-excerpt,
.blog-card-content {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.category-pagination {
    display: grid;
    gap: 20px;
}

.category-page {
    align-items: stretch;
}

.category-pagination-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.category-page-button {
    min-width: 46px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(22, 119, 240, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #17417d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.category-page-button:hover {
    transform: translateY(-1px);
    background: #eef5ff;
}

.category-page-button.is-active {
    background: linear-gradient(180deg, #2f92ff 0%, #166fe3 100%);
    color: #ffffff;
    border-color: transparent;
}

.category-page {
    display: none;
}

.category-page.is-active {
    display: grid;
}

.category-page[hidden] {
    display: none !important;
}

.blog-archive-section {
    display: grid;
    gap: 24px;
    padding-top: 36px;
}

.blog-archive-header {
    text-align: left;
}

.blog-archive-pagination a {
    text-decoration: none;
}
