/*
Theme Name: Porch
Author: Theme Developer
Description: Academic news theme with classic typography and scholarly design. Inspired by prestigious university publications.
Version: 1.5.1
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: porch
Tags: education, news, academic, grid-layout, custom-colors, custom-logo, featured-images, translation-ready
*/

/* === CSS VARIABLES === */
:root {
    --porch-color-primary: #a51c30;
    --porch-color-secondary: #1e1e1e;
    --porch-color-accent: #c6a876;
    --porch-color-text: #333333;
    --porch-color-text-light: #6c757d;
    --porch-color-bg: #ffffff;
    --porch-color-bg-alt: #f8f7f5;
    --porch-color-border: #e5e5e5;
    --harv-font-heading: 'Crimson Text', Georgia, serif;
    --harv-font-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    --porch-font-heading: var(--harv-font-heading);
    --porch-font-body: var(--harv-font-body);
    --porch-max-width: 1200px;
    --porch-spacing: 24px;
    --porch-radius: 0;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--porch-font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--porch-color-text);
    background: var(--porch-color-bg);
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--porch-font-heading);
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 0.5em;
    color: var(--porch-color-heading, var(--porch-color-secondary));
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
a { color: var(--porch-color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--porch-color-secondary); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1.5em; }

/* === ACCESSIBILITY === */
.porch-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--porch-color-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    font-weight: 600;
}
.porch-skip-link:focus { left: 0; }

/* === HEADER === */
.porch-header {
    background: var(--porch-color-bg);
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-header-inner {
    max-width: var(--porch-max-width);
    margin: 0 auto;
    padding: 0 var(--porch-spacing);
}
.porch-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-logo-wrap { flex: 1; text-align: center; }
.porch-logo a {
    font-family: var(--porch-font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--porch-color-primary);
    text-decoration: none;
}
.porch-logo a:hover { text-decoration: none; color: var(--porch-color-secondary); }
.porch-logo img,
.porch-logo .custom-logo { max-height: 50px; width: auto; height: auto; margin: 0 auto; }
.porch-logo-wrap .custom-logo-link { display: inline-block; }
.porch-logo-wrap .custom-logo,
.porch-logo-wrap .custom-logo-link img {
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.porch-menu-close { display: none; }
.porch-menu-overlay { display: none; }
.porch-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--porch-color-secondary);
}
.porch-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}
.porch-header-actions { display: flex; align-items: center; gap: 16px; }
.porch-search-toggle {
    background: none;
    border: none;
    color: var(--porch-color-secondary);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}
.porch-search-toggle:hover { color: var(--porch-color-primary); }

/* === NAVIGATION === */
.porch-nav { background: var(--porch-color-secondary); }
.porch-nav-menu {
    display: flex;
    justify-content: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 14px 0;
}
.porch-nav-menu li { position: relative; }
.porch-nav-menu a {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    padding: 4px 0;
}
.porch-nav-menu a:hover { color: var(--porch-color-accent); text-decoration: none; }
.porch-nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--porch-color-secondary);
    min-width: 200px;
    list-style: none;
    padding: 8px 0;
    margin-top: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.porch-nav-menu li:hover > .sub-menu { opacity: 1; visibility: visible; }
.porch-nav-menu .sub-menu a {
    display: block;
    padding: 8px 20px;
    font-size: 0.8rem;
    text-transform: none;
}

/* === SEARCH OVERLAY === */
.porch-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.porch-search-overlay.porch-search-active { opacity: 1; visibility: visible; }
.porch-search-container {
    width: 90%;
    max-width: 600px;
    position: relative;
}
.porch-search-container input[type="search"] {
    width: 100%;
    padding: 20px;
    font-size: 1.25rem;
    border: none;
    border-bottom: 2px solid var(--porch-color-primary);
    background: transparent;
    color: var(--porch-color-secondary);
    font-family: var(--porch-font-body);
}
.porch-search-container input[type="search"]::placeholder { color: var(--porch-color-text-light); }
.porch-search-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--porch-color-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 16px;
}

/* === MAIN CONTENT === */
.porch-main { min-height: 60vh; }
.porch-content {
    max-width: var(--porch-max-width);
    margin: 0 auto;
    padding: var(--porch-spacing);
}
.porch-content-inner { display: flex; gap: 48px; }
.porch-articles { flex: 1; min-width: 0; }

/* === SIDEBAR === */
.porch-has-sidebar .porch-articles { flex: 1; }
.porch-sidebar { width: 300px; flex-shrink: 0; }
.porch-has-sidebar.porch-sidebar-left .porch-content-inner { flex-direction: row-reverse; }
.porch-widget {
    margin-bottom: var(--porch-spacing);
    padding-bottom: var(--porch-spacing);
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-widget:last-child { border-bottom: none; }
.porch-widget-title {
    font-family: var(--porch-font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--porch-color-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--porch-color-primary);
}

/* === FEATURED === */
.porch-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-featured-main { }
.porch-featured-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: 20px;
}
.porch-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.porch-featured-image:hover img { transform: scale(1.03); }
.porch-featured-content { }
.porch-featured-title {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 12px;
}
.porch-featured-title a { color: var(--porch-color-heading, var(--porch-color-secondary)); text-decoration: none; }
.porch-featured-title a:hover { color: var(--porch-color-primary); text-decoration: none; }
.porch-featured-excerpt {
    color: var(--porch-color-text-light);
    margin-bottom: 12px;
}
.porch-featured-meta {
    font-size: 0.8rem;
    color: var(--porch-color-text-light);
}
.porch-featured-secondary {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.porch-featured-small {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-featured-small:last-child { border-bottom: none; padding-bottom: 0; }
.porch-featured-small-image {
    aspect-ratio: 1;
    overflow: hidden;
}
.porch-featured-small-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.porch-featured-small-title {
    font-size: 1rem;
    margin-bottom: 8px;
}
.porch-featured-small-title a { color: var(--porch-color-heading, var(--porch-color-secondary)); text-decoration: none; }
.porch-featured-small-title a:hover { color: var(--porch-color-primary); }

/* === CATEGORY === */
.porch-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--porch-color-primary);
    margin-bottom: 8px;
}
.porch-category:hover { color: var(--porch-color-secondary); text-decoration: none; }

/* === ARTICLE GRID === */
.porch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.porch-card { }
.porch-card-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: 16px;
}
.porch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.porch-card:hover .porch-card-image img { transform: scale(1.03); }
.porch-card-title {
    font-size: 1.125rem;
    line-height: 1.35;
    margin-bottom: 8px;
}
.porch-card-title a { color: var(--porch-color-heading, var(--porch-color-secondary)); text-decoration: none; }
.porch-card-title a:hover { color: var(--porch-color-primary); text-decoration: none; }
.porch-card-excerpt {
    font-size: 0.9rem;
    color: var(--porch-color-text-light);
    margin-bottom: 8px;
}
.porch-card-meta {
    font-size: 0.75rem;
    color: var(--porch-color-text-light);
}
.porch-sticky { position: relative; }
.porch-sticky::before {
    content: "Закреплено";
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--porch-color-primary);
    color: #fff;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    z-index: 1;
}

/* === SINGLE POST === */
.porch-single-header {
    max-width: 720px;
    margin: 0 auto 32px;
}
.porch-single-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 16px;
}
.porch-single-meta {
    font-size: 0.875rem;
    color: var(--porch-color-text-light);
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.porch-single-image {
    margin: 0 0 32px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.porch-single-image img { width: 100%; }
.porch-single-image figcaption {
    font-size: 0.8rem;
    color: var(--porch-color-text-light);
    padding: 12px 0;
    font-style: italic;
}
.porch-single-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.85;
}
.porch-single-content h2 { font-size: 1.5rem; margin-top: 48px; }
.porch-single-content h3 { font-size: 1.25rem; margin-top: 32px; }
.porch-single-content blockquote {
    border-left: 3px solid var(--porch-color-primary);
    margin: 32px 0;
    padding: 16px 32px;
    font-style: italic;
    color: var(--porch-color-text-light);
    background: var(--porch-color-bg-alt);
}
.porch-single-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.9375rem; overflow-x: auto; display: block; }
.porch-single-content thead { background: var(--porch-color-bg-alt, #f4f4f4); }
.porch-single-content th, .porch-single-content td { padding: 0.75rem 1rem; border: 1px solid var(--porch-color-border, #ddd); text-align: left; vertical-align: top; }
.porch-single-content th { font-weight: 700; white-space: nowrap; }
.porch-single-content tr:nth-child(even) { background: var(--porch-color-bg-alt, #f8f8f8); }
.porch-single-footer {
    max-width: 720px;
    margin: 48px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--porch-color-border);
}
.porch-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.porch-tag {
    font-size: 0.75rem;
    padding: 4px 12px;
    background: var(--porch-color-bg-alt);
    color: var(--porch-color-text);
    border: 1px solid var(--porch-color-border);
}
.porch-tag:hover { background: var(--porch-color-primary); color: #fff; border-color: var(--porch-color-primary); text-decoration: none; }

/* === SHARE === */
.porch-share {
    max-width: 720px;
    margin: 32px auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.porch-share-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--porch-color-text-light);
}
.porch-share-link {
    font-size: 0.8rem;
    padding: 8px 16px;
    background: var(--porch-color-bg-alt);
    color: var(--porch-color-text);
    border: 1px solid var(--porch-color-border);
}
.porch-share-link:hover { background: var(--porch-color-primary); color: #fff; border-color: var(--porch-color-primary); text-decoration: none; }

/* === AUTHOR BOX === */
.porch-author-box {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--porch-color-bg-alt);
    max-width: 720px;
}

.porch-author-avatar img { width: 80px; height: 80px; border-radius: 50%; }
.porch-author-info { flex: 1; }
.porch-author-name { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.25rem; }
.porch-author-name a { color: var(--porch-color-heading, var(--porch-color-secondary)); text-decoration: none; }
.porch-author-name a:hover { color: var(--porch-color-primary); }
.porch-author-bio { font-size: 0.9375rem; color: var(--porch-color-text-light); }

/* === POST NAVIGATION === */
.porch-post-nav {
    max-width: 720px;
    margin: 48px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.porch-post-nav-prev, .porch-post-nav-next {
    padding: 20px;
    background: var(--porch-color-bg-alt);
    text-decoration: none;
}
.porch-post-nav-prev:hover, .porch-post-nav-next:hover { text-decoration: none; }
.porch-post-nav-next { text-align: right; }
.porch-post-nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--porch-color-text-light);
    display: block;
    margin-bottom: 8px;
}
.porch-post-nav-title { font-weight: 600; color: var(--porch-color-heading, var(--porch-color-secondary)); }

/* === RELATED === */
.porch-related {
    max-width: 720px;
    margin: 64px auto;
}
.porch-related-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--porch-color-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--porch-color-primary);
}
.porch-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.porch-related-card-title { font-size: 0.95rem; margin-top: 12px; }
.porch-related-card-title a { color: var(--porch-color-heading, var(--porch-color-secondary)); text-decoration: none; }
.porch-related-card-title a:hover { color: var(--porch-color-primary); }

/* === PAGE === */
.porch-page-header { max-width: 720px; margin: 0 auto 32px; }
.porch-page-title { font-size: 2.5rem; }
.porch-page-content { max-width: 720px; margin: 0 auto; font-size: 1.125rem; line-height: 1.85; }

/* === ARCHIVE === */
.porch-archive-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-archive-title { font-size: 2rem; margin-bottom: 8px; }
.porch-archive-desc { color: var(--porch-color-text-light); }

/* === SEARCH === */
.porch-search-header { margin-bottom: 48px; }
.porch-search-title { font-size: 1.5rem; }
.porch-search-title span { color: var(--porch-color-primary); }
.porch-articles-list { display: flex; flex-direction: column; gap: 32px; }
.porch-search-card {
    display: flex;
    gap: 24px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--porch-color-border);
}
.porch-search-image { width: 180px; flex-shrink: 0; overflow: hidden; aspect-ratio: 16/10; }
.porch-search-image img { width: 100%; height: 100%; object-fit: cover; }
.porch-search-card-title { font-size: 1.25rem; margin-bottom: 8px; }
.porch-search-card-title a { color: var(--porch-color-heading, var(--porch-color-secondary)); text-decoration: none; }
.porch-search-card-title a:hover { color: var(--porch-color-primary); }
.porch-search-excerpt { font-size: 0.9rem; color: var(--porch-color-text-light); margin-bottom: 8px; }
.porch-search-meta { font-size: 0.75rem; color: var(--porch-color-text-light); }
.porch-no-results { text-align: center; padding: 64px var(--porch-spacing); }
.porch-no-results h2 { font-size: 2rem; margin-bottom: 16px; }
.porch-search-form-wrap { max-width: 400px; margin: 24px auto 0; }

/* === 404 === */
.porch-error-page { text-align: center; padding: 80px var(--porch-spacing); }
.porch-error-code {
    font-family: var(--porch-font-heading);
    font-size: 6rem;
    font-weight: 700;
    color: var(--porch-color-primary);
    line-height: 1;
}
.porch-error-title { font-size: 2rem; margin: 24px 0 16px; }
.porch-error-text { color: var(--porch-color-text-light); max-width: 500px; margin: 0 auto 32px; }
.porch-error-search { max-width: 400px; margin: 0 auto 32px; }
.porch-error-home {
    display: inline-block;
    background: var(--porch-color-primary);
    color: #fff;
    padding: 12px 32px;
    font-weight: 600;
}
.porch-error-home:hover { background: var(--porch-color-secondary); text-decoration: none; }

/* === PAGINATION === */
.porch-pagination {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--porch-color-border);
}
.porch-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.porch-pagination a, .porch-pagination span {
    display: block;
    padding: 8px 16px;
    font-size: 0.875rem;
    background: var(--porch-color-bg-alt);
    color: var(--porch-color-text);
    text-decoration: none;
}
.porch-pagination a:hover { background: var(--porch-color-primary); color: #fff; }
.porch-pagination .current { background: var(--porch-color-primary); color: #fff; }

/* === BREADCRUMBS === */
.porch-breadcrumbs {
    font-size: 0.75rem;
    margin-bottom: 24px;
    color: var(--porch-color-text-light);
}
.porch-breadcrumbs a { color: var(--porch-color-text-light); text-decoration: none; }
.porch-breadcrumbs a:hover { color: var(--porch-color-primary); }
.porch-breadcrumbs .separator { margin: 0 8px; }

/* === COMMENTS === */
.porch-comments { max-width: 720px; margin: 64px auto 0; padding-top: 32px; border-top: 1px solid var(--porch-color-border); }
.porch-comments-title { font-size: 1.25rem; margin-bottom: 32px; }
.porch-comments-list { list-style: none; margin: 0; padding: 0; }
.porch-comment { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--porch-color-border); }
.porch-comment-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.porch-comment-avatar img { border-radius: 50%; }
.porch-comment-author { font-weight: 600; }
.porch-comment-date { font-size: 0.8rem; color: var(--porch-color-text-light); }
.porch-comment-content { font-size: 0.95rem; }
.porch-comment-actions { margin-top: 12px; }
.porch-comment-actions a { font-size: 0.8rem; color: var(--porch-color-text-light); margin-right: 16px; }
.porch-comments-closed { color: var(--porch-color-text-light); font-style: italic; }
.porch-comment-form { margin-top: 32px; }
.porch-comment-form label { display: block; margin-bottom: 8px; font-weight: 600; }
.porch-comment-form input[type="text"],
.porch-comment-form input[type="email"],
.porch-comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--porch-color-border);
    margin-bottom: 16px;
    font-family: inherit;
    font-size: 1rem;
}
.porch-comment-form textarea { min-height: 150px; }
.porch-comment-form input[type="submit"] {
    background: var(--porch-color-primary);
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-weight: 600;
    cursor: pointer;
}
.porch-comment-form input[type="submit"]:hover { background: var(--porch-color-secondary); }

/* === FOOTER === */
.porch-footer {
    background: var(--porch-color-secondary);
    color: #fff;
    padding: 24px 0 0;
    margin-top: 32px;
}
.porch-footer-inner { max-width: var(--porch-max-width); margin: 0 auto; padding: 0 var(--porch-spacing); }
.porch-footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.porch-footer-widget-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--porch-color-accent);
    margin-bottom: 16px;
}
.porch-footer-widget a { color: rgba(255,255,255,0.7); text-decoration: none; }
.porch-footer-widget a:hover { color: #fff; }
.porch-footer-widget ul { list-style: none; margin: 0; padding: 0; }
.porch-footer-widget li { margin-bottom: 8px; }
.porch-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}
.porch-footer-menu { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.porch-footer-menu a { color: rgba(255,255,255,0.7); font-size: 0.8rem; text-decoration: none; }
.porch-footer-menu a:hover { color: #fff; }
.porch-copyright { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.porch-footer-description { display: block; font-size: 0.75rem; opacity: 0.6; margin-top: 0.25rem; }

/* === SCROLL TO TOP === */
.porch-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--porch-color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.porch-scroll-top:hover { background: var(--porch-color-secondary); }
.porch-scroll-top.porch-visible { opacity: 1; visibility: visible; }

/* === FORMS === */
.search-form { display: flex; }
.search-form input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--porch-color-border);
    border-right: none;
    font-size: 1rem;
    font-family: inherit;
}
.search-form input[type="submit"] {
    padding: 12px 20px;
    background: var(--porch-color-primary);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
}
.search-form input[type="submit"]:hover { background: var(--porch-color-secondary); }

/* === PAGE LINKS === */
.porch-page-links { margin: 32px 0; font-weight: 600; }
.porch-page-links span { margin-right: 8px; }
.porch-page-links a { margin: 0 4px; padding: 4px 12px; background: var(--porch-color-bg-alt); text-decoration: none; }
.porch-page-links a:hover { background: var(--porch-color-primary); color: #fff; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .porch-grid { grid-template-columns: repeat(2, 1fr); }
    .porch-sidebar { width: 260px; }
    .porch-footer-widgets { grid-template-columns: repeat(2, 1fr); }
    .porch-related-grid { grid-template-columns: repeat(2, 1fr); }
    .porch-featured { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --porch-spacing: 16px; }
    .porch-logo img,
    .porch-logo .custom-logo { max-height: 40px; }
    .porch-logo-wrap .custom-logo,
    .porch-logo-wrap .custom-logo-link img { max-height: 40px; }
    .porch-menu-toggle { display: block; }
    .porch-menu-close { display: block; }
    .porch-menu-overlay { display: block; }
    .porch-nav {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--porch-color-secondary);
        z-index: 3000;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding-top: 60px;
    }
    .porch-nav.porch-nav-open { left: 0; }
    .porch-menu-close {
        position: absolute;
        top: 12px;
        right: 12px;
        background: none;
        border: none;
        color: #fff;
        font-size: 2rem;
        cursor: pointer;
        padding: 4px 12px;
        line-height: 1;
        z-index: 1;
    }
    .porch-menu-close:hover { color: var(--porch-color-accent); }
    .porch-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 2999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    .porch-menu-open .porch-menu-overlay { opacity: 1; visibility: visible; }
    .porch-nav-menu { flex-direction: column; gap: 0; padding: 16px 0; }
    .porch-nav-menu a { display: block; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .porch-nav-menu .sub-menu { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; padding-left: 20px; margin-top: 0; }
    .porch-content-inner { flex-direction: column; }
    .porch-sidebar { display: none !important; }
    .porch-has-sidebar.porch-sidebar-left .porch-content-inner { flex-direction: column; }
    .porch-grid { grid-template-columns: 1fr; }
    .porch-single-title { font-size: 2rem; }
    .porch-footer-widgets { grid-template-columns: 1fr; gap: 32px; }
    .porch-footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
    .porch-post-nav { grid-template-columns: 1fr; }
    .porch-search-card { flex-direction: column; }
    .porch-search-image { width: 100%; }
    .porch-related-grid { grid-template-columns: 1fr; }
    .porch-featured-small { grid-template-columns: 80px 1fr; }
}

/* Interlinking Section */
.porch-interlinking {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}
.porch-interlinking-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}
.porch-interlinking-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.porch-interlinking-list li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}
.porch-interlinking-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--porch-color-primary, #333);
}
.porch-interlinking-list a {
    color: var(--porch-color-primary, #333);
    text-decoration: none;
}
.porch-interlinking-list a:hover {
    text-decoration: underline;
}

/* Grid Layouts */
.grid-3col .porch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.grid-2col .porch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
.grid-list .porch-grid {
    display: block;
}
.grid-list .porch-card {
    margin-bottom: 30px;
}
@media (max-width: 1024px) {
    .grid-3col .porch-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .grid-3col .porch-grid,
    .grid-2col .porch-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Structural Diversification — card_style
   ========================================================================== */

/* card_style: horizontal */
body.porch-card-horizontal .porch-grid {
    grid-template-columns: 1fr;
}
body.porch-card-horizontal .porch-card {
    display: flex;
    flex-direction: row;
}
body.porch-card-horizontal .porch-card-image {
    width: 40%;
    flex-shrink: 0;
    aspect-ratio: auto;
}
body.porch-card-horizontal .porch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (max-width: 768px) {
    body.porch-card-horizontal .porch-card {
        flex-direction: column;
    }
    body.porch-card-horizontal .porch-card-image {
        width: 100%;
    }
}

/* card_style: overlay */
body.porch-card-overlay .porch-card {
    position: relative;
    min-height: 280px;
    overflow: hidden;
}
body.porch-card-overlay .porch-card-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    aspect-ratio: auto;
}
body.porch-card-overlay .porch-card-image img {
    width: 100%; height: 100%; object-fit: cover;
}
body.porch-card-overlay .porch-card::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 70%; z-index: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    pointer-events: none;
}
body.porch-card-overlay .porch-card-title,
body.porch-card-overlay .porch-card-meta,
body.porch-card-overlay .porch-card-excerpt {
    position: relative; z-index: 1;
}
body.porch-card-overlay .porch-card-title a,
body.porch-card-overlay .porch-card-meta,
body.porch-card-overlay .porch-card-excerpt { color: #fff; }
body.porch-card-overlay .porch-card-category {
    position: relative; z-index: 1;
}

/* card_style: text */
body.porch-card-text .porch-card-image { display: none; }
body.porch-card-text .porch-card {
    border-left: 3px solid var(--porch-primary, #a51c30);
    padding-left: 1rem;
}

/* ==========================================================================
   Structural Diversification — header_layout
   ========================================================================== */

/* header_layout: centered */
body.porch-header-centered .porch-header-inner {
    flex-direction: column; align-items: center; gap: 0.75rem;
}
body.porch-header-centered .porch-nav { order: 2; }
body.porch-header-centered .porch-header-actions {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
}
@media (max-width: 768px) {
    body.porch-header-centered .porch-header-inner {
        flex-direction: row; align-items: center;
    }
    body.porch-header-centered .porch-header-actions {
        position: static; transform: none;
    }
}

/* header_layout: stacked */
body.porch-header-stacked .porch-header-inner {
    flex-wrap: wrap; gap: 0;
}
body.porch-header-stacked .porch-logo-wrap {
    width: 100%; text-align: center; padding: 0.75rem 0 0.5rem;
}
body.porch-header-stacked .porch-nav { flex: 1; justify-content: center; }
@media (max-width: 768px) {
    body.porch-header-stacked .porch-logo-wrap {
        width: auto; text-align: left; padding: 0;
    }
}

/* ==========================================================================
   Structural Diversification — featured_style
   ========================================================================== */

/* featured_style: hero */
body.porch-featured-hero .porch-featured { display: block; }
body.porch-featured-hero .porch-featured > *:not(:first-child) { display: none; }
body.porch-featured-hero .porch-featured > *:first-child {
    position: relative; min-height: 400px; overflow: hidden;
    border-radius: var(--porch-radius, 8px);
}
body.porch-featured-hero .porch-featured > *:first-child .porch-card-image,
body.porch-featured-hero .porch-featured > *:first-child .porch-featured-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; aspect-ratio: auto;
}
body.porch-featured-hero .porch-featured > *:first-child::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 60%; z-index: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    pointer-events: none;
}
body.porch-featured-hero .porch-featured > *:first-child .porch-card-title,
body.porch-featured-hero .porch-featured > *:first-child .porch-featured-title {
    position: relative; z-index: 1;
}
body.porch-featured-hero .porch-featured > *:first-child .porch-card-title a,
body.porch-featured-hero .porch-featured > *:first-child .porch-featured-title a {
    color: #fff; font-size: 2rem;
}

/* featured_style: none */
body.porch-featured-none .porch-featured { display: none; }

/* ==========================================================================
   Structural Diversification — effect_card_hover
   ========================================================================== */

/* hover: lift */
body.porch-hover-lift .porch-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
/* hover: shadow */
body.porch-hover-shadow .porch-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}
/* hover: glow */
body.porch-hover-glow .porch-card:hover {
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
}
/* hover: border */
body.porch-hover-border .porch-card:hover {
    border-color: var(--porch-primary, #a51c30);
}
