/*
Theme Name: 唐左频道
Theme URI: https://tangzuo.com
Author: 唐左
Author URI: https://tangzuo.com
Description: 唐左频道 — 为零基础建站新手、外贸SOHO和小企业主提供独立站建站、WordPress实操、主机VPS选型、域名指南、Google SEO优化等系统化教程指导。极简专业、个人分享向的中文技术教程博客主题。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tangzuo
Tags: blog, education, one-column, custom-colors, custom-menu, featured-images, full-site-editing, block-patterns, block-styles, wide-blocks, translation-ready
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ==========================================================================
   Foundation — global resets and base polish
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    word-break: break-all;
    word-break: break-word;
}

:root,
body,
.wp-site-blocks {
    overflow: visible;
}

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

figure {
    margin: 0;
}

/* ==========================================================================
   Typography polish
   ========================================================================== */

body,
.editor-styles-wrapper {
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
}

p {
    margin-top: 0;
    margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0;
}

/* Subtle heading spacing within article flow */
.entry-content h2,
.wp-block-post-content h2 {
    margin-top: var(--wp--preset--spacing--60);
    margin-bottom: var(--wp--preset--spacing--30);
}

.entry-content h3,
.wp-block-post-content h3 {
    margin-top: var(--wp--preset--spacing--50);
    margin-bottom: var(--wp--preset--spacing--20);
}

.entry-content h4,
.wp-block-post-content h4 {
    margin-top: var(--wp--preset--spacing--40);
    margin-bottom: var(--wp--preset--spacing--20);
}

/* Chinese typography: slightly tighter inter-character spacing for headings */
h1, h2, h3 {
    letter-spacing: 0;
}

/* ==========================================================================
   Link styles
   ========================================================================== */

a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Content area links: subtle underline offset for readability */
.entry-content a,
.wp-block-post-content a {
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.entry-content a:hover,
.wp-block-post-content a:hover {
    text-decoration-thickness: 2px;
}

/* ==========================================================================
   Button styles
   ========================================================================== */

.wp-block-button__link,
.wp-element-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    font-family: var(--wp--preset--font-family--sans);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 600;
    line-height: 1.5;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
    text-decoration: none;
}

/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
}

/* ==========================================================================
   Card styling — unified 8px radius, faint shadow, hover lift
   ========================================================================== */

.card,
.wp-block-post {
    background: var(--wp--preset--color--surface);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06), 0 1px 2px rgba(26, 26, 46, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.card:hover,
.wp-block-post:hover {
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.1), 0 2px 4px rgba(26, 26, 46, 0.06);
    transform: translateY(-2px);
}

/* Post template grid cards within query blocks */
.wp-block-post-template .wp-block-post {
    display: flex;
    flex-direction: column;
}

.wp-block-post-template .wp-block-post .wp-block-post-featured-image {
    margin: 0;
}

.wp-block-post-template .wp-block-post .wp-block-post-featured-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

/* ==========================================================================
   Single-column article list (is-style-loop-single-col)
   ========================================================================== */

.wp-block-query.is-style-loop-single-col .wp-block-post-template {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--40);
}

.wp-block-query.is-style-loop-single-col .wp-block-post-template > li {
    list-style: none;
}

.wp-block-query.is-style-loop-single-col .wp-block-post {
    flex-direction: row;
    border-radius: 8px;
    overflow: hidden;
    background: var(--wp--preset--color--surface);
    box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06), 0 1px 2px rgba(26, 26, 46, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    border-left: 4px solid var(--wp--preset--color--primary);
}

/* Alternate left-border accent colors for visual rhythm */
.wp-block-query.is-style-loop-single-col .wp-block-post-template > li:nth-child(4n+1) .wp-block-post {
    border-left-color: var(--wp--preset--color--accent-green);
}

.wp-block-query.is-style-loop-single-col .wp-block-post-template > li:nth-child(4n+2) .wp-block-post {
    border-left-color: var(--wp--preset--color--accent-blue);
}

.wp-block-query.is-style-loop-single-col .wp-block-post-template > li:nth-child(4n+3) .wp-block-post {
    border-left-color: var(--wp--preset--color--accent-purple);
}

.wp-block-query.is-style-loop-single-col .wp-block-post-template > li:nth-child(4n+4) .wp-block-post {
    border-left-color: var(--wp--preset--color--accent-amber);
}

.wp-block-query.is-style-loop-single-col .wp-block-post:hover {
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.1), 0 2px 4px rgba(26, 26, 46, 0.06);
    transform: translateY(-2px);
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-featured-image {
    flex: 0 0 260px;
    margin: 0;
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-featured-image img {
    width: 260px;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-title {
    font-size: var(--wp--preset--font-size--x-large);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--wp--preset--spacing--20);
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-excerpt {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--secondary-text);
    line-height: 1.75;
    margin-bottom: 0;
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-date {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
}

.wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-terms {
    font-size: var(--wp--preset--font-size--small);
}

/* Card footer: category left */
.wp-block-query.is-style-loop-single-col .wp-block-post .card-meta-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto;
    padding-top: var(--wp--preset--spacing--20);
}

/* Title row: title left, date right */
.wp-block-query.is-style-loop-single-col .wp-block-post .card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--wp--preset--spacing--20);
}

.wp-block-query.is-style-loop-single-col .wp-block-post .card-title-row .wp-block-post-title {
    flex: 1;
    min-width: 0;
}

.wp-block-query.is-style-loop-single-col .wp-block-post .card-title-row .wp-block-post-date {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Separator between list items */
.wp-block-query.is-style-loop-single-col .wp-block-post-template > li + li {
    border-top: none;
}

/* Responsive: stack vertically on mobile */
@media (max-width: 781px) {
    .wp-block-query.is-style-loop-single-col .wp-block-post {
        flex-direction: column;
    }

    .wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-featured-image {
        flex: none;
    }

    .wp-block-query.is-style-loop-single-col .wp-block-post .wp-block-post-featured-image img {
        width: 100%;
        height: 200px;
        border-radius: 8px 8px 0 0;
    }
}

/* ==========================================================================
   Image treatments
   ========================================================================== */

.wp-block-image img {
    border-radius: 8px;
}

.wp-block-image figcaption {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
    margin-top: var(--wp--preset--spacing--20);
    text-align: center;
}

.wp-block-post-featured-image img {
    border-radius: 8px;
}

/* ==========================================================================
   Code blocks — white bg, thin border, mono font
   ========================================================================== */

.wp-block-code code,
pre.wp-block-preformatted {
    font-family: var(--wp--preset--font-family--mono);
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
}

.wp-block-code {
    position: relative;
}

/* Inline code */
:not(pre) > code {
    font-family: var(--wp--preset--font-family--mono);
    font-size: 0.85em;
    background: var(--wp--preset--color--background);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 4px;
    padding: 0.15em 0.4em;
    color: var(--wp--preset--color--text);
}

/* ==========================================================================
   Blockquote polish
   ========================================================================== */

.wp-block-quote {
    font-style: normal;
}

.wp-block-quote cite {
    display: block;
    margin-top: var(--wp--preset--spacing--20);
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
    font-style: normal;
}

/* ==========================================================================
   Table polish
   ========================================================================== */

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table th {
    background: var(--wp--preset--color--background);
    font-weight: 600;
    text-align: left;
}

.wp-block-table th,
.wp-block-table td {
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    border: 1px solid var(--wp--preset--color--border);
}

.wp-block-table tbody tr:hover {
    background: var(--wp--preset--color--background);
}

/* ==========================================================================
   Separator
   ========================================================================== */

.wp-block-separator {
    opacity: 1;
}

.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
    max-width: 100px;
    margin-left: auto;
    margin-right: auto;
}

.wp-block-separator.is-style-wide {
    max-width: 100%;
}

/* ==========================================================================
   Navigation — desktop: bottom-line highlight, hover color shift
   ========================================================================== */

.wp-block-navigation .wp-block-navigation-item__content {
    position: relative;
    transition: color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item__content::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--wp--preset--color--primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content::after,
.wp-block-navigation .wp-block-navigation-item__content:hover::after {
    transform: scaleX(1);
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   Mobile hamburger overlay
   ========================================================================== */

.wp-block-navigation__responsive-container.is-menu-open {
    padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    gap: var(--wp--preset--spacing--30);
    align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-size: var(--wp--preset--font-size--large);
}

/* ==========================================================================
   Breadcrumb styling (custom function output)
   ========================================================================== */

.breadcrumb {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
    padding: var(--wp--preset--spacing--20) 0;
    line-height: 1.5;
}

.breadcrumb a {
    color: var(--wp--preset--color--secondary-text);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.4em;
    color: var(--wp--preset--color--border);
}

/* ==========================================================================
   Pagination — Chinese-style pagination
   ========================================================================== */

.pagination,
.wp-block-query-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--wp--preset--spacing--20);
    padding: var(--wp--preset--spacing--40) 0;
}

.pagination a,
.pagination span,
.wp-block-query-pagination-numbers a,
.wp-block-query-pagination-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--wp--preset--spacing--20);
    border-radius: 6px;
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination a,
.wp-block-query-pagination-numbers a {
    color: var(--wp--preset--color--primary);
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
}

.pagination a:hover,
.wp-block-query-pagination-numbers a:hover {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    border-color: var(--wp--preset--color--primary);
}

.pagination .current,
.wp-block-query-pagination-numbers .current {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--primary);
}

/* ==========================================================================
   Search form
   ========================================================================== */

.wp-block-search__inside-wrapper {
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 6px;
    overflow: hidden;
}

.wp-block-search__input {
    font-family: var(--wp--preset--font-family--sans);
    font-size: var(--wp--preset--font-size--medium);
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    border: none;
    outline: none;
    background: var(--wp--preset--color--surface);
    color: var(--wp--preset--color--text);
}

.wp-block-search__input::placeholder {
    color: var(--wp--preset--color--secondary-text);
}

.wp-block-search__input:focus {
    box-shadow: inset 0 0 0 1px var(--wp--preset--color--primary);
}

.wp-block-search__button {
    font-family: var(--wp--preset--font-family--sans);
    font-weight: 600;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    border: none;
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wp-block-search__button:hover {
    background: var(--wp--preset--color--primary-hover);
}

/* ==========================================================================
   Accent category/topic color utilities
   ========================================================================== */

.accent-green-light {
    background-color: var(--wp--preset--color--accent-green-light);
    color: var(--wp--preset--color--text);
}

.accent-green {
    color: var(--wp--preset--color--accent-green);
}

.accent-blue-light {
    background-color: var(--wp--preset--color--accent-blue-light);
    color: var(--wp--preset--color--text);
}

.accent-blue {
    color: var(--wp--preset--color--accent-blue);
}

.accent-purple-light {
    background-color: var(--wp--preset--color--accent-purple-light);
    color: var(--wp--preset--color--text);
}

.accent-purple {
    color: var(--wp--preset--color--accent-purple);
}

.accent-amber-light {
    background-color: var(--wp--preset--color--accent-amber-light);
    color: var(--wp--preset--color--text);
}

.accent-amber {
    color: var(--wp--preset--color--accent-amber);
}

/* Category tag pills */
.category-tag {
    display: inline-block;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    padding: 0.2em 0.7em;
    border-radius: 4px;
    line-height: 1.5;
}

/* ==========================================================================
   Step number badges
   ========================================================================== */

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    flex-shrink: 0;
}

/* ==========================================================================
   Checklist styling
   ========================================================================== */

.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: 2em;
    margin-bottom: var(--wp--preset--spacing--20);
    line-height: 1.75;
}

.checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 18px;
    height: 18px;
    border: 2px solid var(--wp--preset--color--primary);
    border-radius: 3px;
    background: var(--wp--preset--color--surface);
}

.checklist li.checked::before {
    background: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
}

.checklist li.checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.45em;
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--wp--preset--color--surface);
    border-bottom: 2px solid var(--wp--preset--color--surface);
    transform: rotate(-45deg);
}

/* ==========================================================================
   Article TOC (Table of Contents)
   ========================================================================== */

.article-toc {
    background: var(--wp--preset--color--background);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 8px;
    padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
    margin-bottom: var(--wp--preset--spacing--40);
}

.article-toc-title {
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    color: var(--wp--preset--color--text);
    margin-bottom: var(--wp--preset--spacing--20);
}

.article-toc ol {
    margin: 0;
    padding-left: 1.5em;
    counter-reset: toc-counter;
}

.article-toc li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.article-toc a {
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--small);
    text-decoration: none;
}

.article-toc a:hover {
    color: var(--wp--preset--color--primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   Single post article styling
   ========================================================================== */

.single-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--20);
    align-items: center;
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
}

.single-post-meta .meta-separator {
    color: var(--wp--preset--color--border);
}

/* Related posts section */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--wp--preset--spacing--40);
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    border-bottom: 1px solid var(--wp--preset--color--border);
    padding: var(--wp--preset--spacing--30) 0;
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    color: var(--wp--preset--color--text);
}

.comment-meta {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
    margin-bottom: var(--wp--preset--spacing--20);
}

.comment-body p {
    line-height: 1.75;
    color: var(--wp--preset--color--text);
}

.comment-reply-link {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--primary);
    font-weight: 500;
}

.comment-reply-link:hover {
    color: var(--wp--preset--color--primary-hover);
}

/* Comment form */
.comment-form label {
    display: block;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    color: var(--wp--preset--color--text);
    margin-bottom: 0.3em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    font-family: var(--wp--preset--font-family--sans);
    font-size: var(--wp--preset--font-size--medium);
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 6px;
    background: var(--wp--preset--color--surface);
    color: var(--wp--preset--color--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 0 0 2px rgba(43, 87, 151, 0.15);
}

.comment-form .form-submit .submit {
    font-family: var(--wp--preset--font-family--sans);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 600;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    border: none;
    border-radius: 6px;
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.comment-form .form-submit .submit:hover {
    background: var(--wp--preset--color--primary-hover);
}

/* ==========================================================================
   404 page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--40);
}

.error-404-number {
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 700;
    color: var(--wp--preset--color--primary);
    line-height: 1;
    opacity: 0.15;
}

/* ==========================================================================
   Archive / category page header
   ========================================================================== */

.archive-header {
    padding: var(--wp--preset--spacing--50) 0;
    margin-bottom: var(--wp--preset--spacing--40);
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.archive-header .archive-title {
    font-size: var(--wp--preset--font-size--xx-large);
    font-weight: 700;
    color: var(--wp--preset--color--text);
    margin-bottom: var(--wp--preset--spacing--20);
}

.archive-header .archive-description {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--secondary-text);
    line-height: 1.75;
    max-width: 680px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer a {
    transition: color 0.2s ease;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Footer link columns */
.footer-links-title {
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    color: var(--wp--preset--color--surface);
    margin-bottom: var(--wp--preset--spacing--20);
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 0.6em;
}

.footer-links-list a {
    font-size: var(--wp--preset--font-size--small);
    opacity: 0.8;
}

.footer-links-list a:hover {
    opacity: 1;
}

/* ==========================================================================
   Hero section polish
   ========================================================================== */

.hero-section {
    text-align: center;
}

.hero-section .hero-title {
    font-size: var(--wp--preset--font-size--hero);
    font-weight: 700;
    line-height: 1.3;
    color: var(--wp--preset--color--text);
    margin-bottom: var(--wp--preset--spacing--30);
}

.hero-section .hero-subtitle {
    font-size: var(--wp--preset--font-size--large);
    color: var(--wp--preset--color--secondary-text);
    line-height: 1.75;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--wp--preset--spacing--40);
}

/* ==========================================================================
   Section headings — centered module titles
   ========================================================================== */

.section-heading {
    text-align: center;
    margin-bottom: var(--wp--preset--spacing--50);
}

.section-heading h2 {
    font-size: var(--wp--preset--font-size--xx-large);
    font-weight: 700;
    color: var(--wp--preset--color--text);
    margin-bottom: var(--wp--preset--spacing--20);
}

.section-heading p {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--secondary-text);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Service / plan cards — accent-tinted backgrounds
   ========================================================================== */

.plan-card {
    border-radius: 8px;
    padding: var(--wp--preset--spacing--40);
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--20);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.plan-card:hover {
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.1);
    transform: translateY(-2px);
}

.plan-card-title {
    font-size: var(--wp--preset--font-size--x-large);
    font-weight: 700;
    line-height: 1.3;
}

.plan-card-desc {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--secondary-text);
    line-height: 1.75;
}

/* ==========================================================================
   Flow steps — horizontal on desktop, vertical on mobile
   ========================================================================== */

.flow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--30);
    justify-content: center;
}

.flow-step {
    flex: 1 1 180px;
    max-width: 200px;
    text-align: center;
    padding: var(--wp--preset--spacing--30);
    background: var(--wp--preset--color--surface);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.flow-step:hover {
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.1);
    transform: translateY(-2px);
}

.flow-step .step-number {
    margin-bottom: var(--wp--preset--spacing--20);
}

.flow-step-title {
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    color: var(--wp--preset--color--text);
    margin-bottom: 0.3em;
}

.flow-step-desc {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary-text);
    line-height: 1.6;
}

/* Arrow connectors between steps (desktop only) */
@media (min-width: 768px) {
    .flow-step + .flow-step {
        position: relative;
    }
    .flow-step + .flow-step::before {
        content: "";
        position: absolute;
        left: calc(var(--wp--preset--spacing--30) * -1 - 8px);
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-left: 8px solid var(--wp--preset--color--border);
    }
}

/* ==========================================================================
   Topic entry cards — icon + accent color stripe
   ========================================================================== */

.topic-card {
    background: var(--wp--preset--color--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.topic-card:hover {
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.1);
    transform: translateY(-2px);
}

.topic-card-accent {
    height: 4px;
    width: 100%;
}

.topic-card-body {
    padding: var(--wp--preset--spacing--40);
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--20);
    flex: 1;
}

/* ==========================================================================
   CTA section — low-pressure conversion
   ========================================================================== */

.cta-section {
    text-align: center;
    background: var(--wp--preset--color--background);
    border-radius: 8px;
    border: 1px solid var(--wp--preset--color--border);
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
}

.cta-section h2 {
    font-size: var(--wp--preset--font-size--x-large);
    font-weight: 700;
    color: var(--wp--preset--color--text);
    margin-bottom: var(--wp--preset--spacing--20);
}

.cta-section p {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--secondary-text);
    line-height: 1.75;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--wp--preset--spacing--30);
}

/* ==========================================================================
   SVG placeholder illustrations
   ========================================================================== */

.svg-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
}

.svg-illustration svg {
    width: 100%;
    height: auto;
    max-width: 600px;
}

/* ==========================================================================
   Sidebar widgets
   ========================================================================== */

.widget {
    margin-bottom: var(--wp--preset--spacing--40);
}

.widget-title {
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    color: var(--wp--preset--color--text);
    margin-bottom: var(--wp--preset--spacing--20);
    padding-bottom: var(--wp--preset--spacing--20);
    border-bottom: 2px solid var(--wp--preset--color--primary);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 0.5em 0;
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--wp--preset--color--text);
    font-size: var(--wp--preset--font-size--small);
}

.widget ul li a:hover {
    color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   Form fields (contact page, etc.)
   ========================================================================== */

.form-field {
    margin-bottom: var(--wp--preset--spacing--30);
}

.form-field label {
    display: block;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    color: var(--wp--preset--color--text);
    margin-bottom: 0.4em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea {
    width: 100%;
    font-family: var(--wp--preset--font-family--sans);
    font-size: var(--wp--preset--font-size--medium);
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 6px;
    background: var(--wp--preset--color--surface);
    color: var(--wp--preset--color--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 0 0 2px rgba(43, 87, 151, 0.15);
}

/* ==========================================================================
   Selection styling
   ========================================================================== */

::selection {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
}

/* ==========================================================================
   Scroll-to-top visual cue (if generated by script.js)
   ========================================================================== */

.scroll-to-top {
    position: fixed;
    bottom: var(--wp--preset--spacing--40);
    right: var(--wp--preset--spacing--40);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.15);
}

.scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--wp--preset--color--primary-hover);
}

.scroll-to-top svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   Focus visible — accessible keyboard focus
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   Equal-height card columns
   ========================================================================== */

.equal-cards > .wp-block-column {
    display: flex;
    flex-direction: column;
}

.equal-cards > .wp-block-column > .wp-block-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.equal-cards .cta-bottom {
    margin-top: auto;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

@media (max-width: 781px) {
    .flow-steps {
        flex-direction: column;
        align-items: center;
    }

    .flow-step {
        max-width: 100%;
    }

    .flow-step + .flow-step::before {
        display: none;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .wp-block-post-template .wp-block-post .wp-block-post-featured-image img {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .hero-section .hero-title {
        font-size: var(--wp--preset--font-size--xxx-large);
    }

    .error-404-number {
        font-size: 5rem;
    }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .site-header,
    .site-footer,
    .breadcrumb,
    .scroll-to-top,
    .pagination,
    .comment-form,
    .wp-block-navigation {
        display: none !important;
    }

    .wp-block-post-featured-image img,
    .wp-block-image img {
        border-radius: 0;
    }
}

/* ---------- Loop layout utilities ---------- */
/* These classes are wired to the wp:query blocks emitted by content/pages and
   templates. Do not rename. Tune colours and spacing to theme.json tokens. */

/* Horizontal scrollable rail */
.wp-block-query.is-style-loop-rail .wp-block-post-template {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: var(--wp--preset--spacing--20);
}
.wp-block-query.is-style-loop-rail .wp-block-post-template > * {
    flex: 0 0 320px;
    scroll-snap-align: start;
}

/* Compact list with hairline row dividers */
.wp-block-query.is-style-loop-list .wp-block-post-template > * {
    border-bottom: 1px solid var(--wp--preset--color--border);
    padding-block: var(--wp--preset--spacing--30);
}
.wp-block-query.is-style-loop-list .wp-block-post-template > *:last-child {
    border-bottom: 0;
}

/* Zigzag — flip the columns inside every even entry */
.wp-block-query.is-style-loop-zigzag .wp-block-post-template > *:nth-child(even) .wp-block-columns {
    flex-direction: row-reverse;
}

/* Timeline — vertical line with node markers per entry */
.wp-block-query.is-style-loop-timeline .wp-block-post-template {
    position: relative;
    padding-inline-start: 2.5rem;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template::before {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0.5rem;
    width: 2px;
    background: currentColor;
    opacity: 0.15;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > * {
    position: relative;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > *::before {
    content: '';
    position: absolute;
    inset-inline-start: -2.25rem;
    inset-block-start: 0.6rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: var(--wp--preset--color--background);
}

/* Magazine — first child spans 2 columns of the grid */
.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
    grid-column: span 2;
}
@media (max-width: 600px) {
    .wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
        grid-column: auto;
    }
}