/* ========================================
   Nutrirora - Layout Styles
   ======================================== */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Site Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 210;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.site-header.is-sticky {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1.5rem;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.site-title:hover {
    text-decoration: none;
    color: var(--primary-light);
}

.site-description {
    display: none;
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.site-logo img {
    max-height: 40px;
    width: auto;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    flex: 1;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition), color var(--transition);
}

.nav-menu a:hover {
    background-color: var(--bg-soft);
    color: var(--primary);
    text-decoration: none;
}

/* Header Search */
.header-search {
    position: relative;
    flex-shrink: 0;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
}

.search-toggle:hover {
    background-color: var(--bg-soft);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 320px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    box-shadow: var(--shadow-md);
    z-index: 101;
}

.search-dropdown[hidden] {
    display: none;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    background: var(--bg);
}

.search-input:focus {
    border-color: var(--primary);
    outline: none;
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--bg);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
}

.search-submit:hover {
    background: var(--primary-light);
}

/* Site Main */
.site-main {
    min-height: calc(100vh - 64px - 300px);
}

/* Content Wrapper */
.content-wrapper {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Site Footer */
.site-footer {
    background-color: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding-top: 3rem;
    padding-bottom: 1.5rem;
}

/* Footer Columns */
.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-brand .footer-description {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-top: 0.5rem;
}

.footer-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.footer-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-menu a {
    font-size: 0.9375rem;
    color: var(--text-light);
    transition: color var(--transition);
}

.footer-menu a:hover {
    color: var(--primary);
}

.footer-categories {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-categories li a {
    font-size: 0.9375rem;
    color: var(--text-light);
    transition: color var(--transition);
}

.footer-categories li a:hover {
    color: var(--primary);
}

/* Copyright */
.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.copyright p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    margin-bottom: 0.5rem;
}

.archive-description {
    color: var(--text-light);
    font-size: 1.0625rem;
}

/* Single Article */
.single-article {
    max-width: 800px;
    margin: 0 auto;
}

.entry-header {
    margin-bottom: 2rem;
}

.entry-thumbnail {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.entry-meta-top .category-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

.entry-meta-top .category-link:hover {
    background: var(--primary);
    color: var(--bg);
    text-decoration: none;
}

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

.entry-title {
    margin-bottom: 1rem;
    line-height: 1.2;
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9375rem;
    color: var(--text-light);
}

.entry-author {
    font-weight: 500;
    color: var(--text);
}

.entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.entry-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary);
    background: var(--bg-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.entry-content blockquote p {
    margin: 0;
    font-style: italic;
}

.entry-content img {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.entry-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Tables */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.entry-content thead {
    background: var(--bg-soft);
}

.entry-content th,
.entry-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.entry-content th {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.entry-content tbody tr:last-child td {
    border-bottom: none;
}

.entry-content tbody tr:hover {
    background: var(--bg-soft);
}

.entry-content td {
    color: var(--text-light);
}

/* Entry Footer */
.entry-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.entry-tags {
    margin-bottom: 1.5rem;
}

.tags-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Page Article */
.page-article {
    max-width: 800px;
    margin: 0 auto;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    margin-top: 2.5rem;
}

.author-avatar .avatar-img {
    border-radius: 50%;
}

.author-name {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.author-bio {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin: 0;
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    font-size: 0.9375rem;
}

.share-link {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    transition: background-color var(--transition), color var(--transition);
}

.share-link:hover {
    background: var(--primary);
    color: var(--bg);
    text-decoration: none;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--border);
}

.breadcrumb-list a {
    color: var(--text-light);
}

.breadcrumb-list a:hover {
    color: var(--primary);
}

/* Pagination */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination ul {
    display: flex;
    gap: 0.25rem;
    list-style: none;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    transition: background-color var(--transition), color var(--transition);
}

.pagination a:hover {
    background: var(--bg-soft);
    text-decoration: none;
}

.pagination .current {
    background: var(--primary);
    color: var(--bg);
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    grid-column: 1 / -1;
}

.no-posts h2 {
    margin-bottom: 0.5rem;
}

/* Error 404 */
.error-404 {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.error-code {
    font-size: clamp(4rem, 10vw, 6rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-404 h2 {
    margin-bottom: 1rem;
}

.error-search {
    margin: 2rem 0;
}

.error-search .search-form {
    justify-content: center;
}

/* Comments */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-title {
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
}

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

.comment-content {
    font-size: 0.9375rem;
    color: var(--text-light);
}

.comment-reply-link {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Comment Form */
.comment-form {
    margin-top: 1.5rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    background: var(--bg);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary);
    outline: none;
}

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

.comment-form-submit {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    background: var(--primary);
    color: var(--bg);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background-color var(--transition);
}

.comment-form-submit:hover {
    background: var(--primary-light);
}

/* Table of Contents */
.table-of-contents {
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: decimal;
    padding-left: 1.25rem;
}

.toc-list li {
    margin-bottom: 0.375rem;
}

.toc-list a {
    font-size: 0.9375rem;
}

/* Contact Form */
.contact-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    background: var(--bg);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.contact-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    display: none;
}

.contact-message.is-visible {
    display: block;
}

.contact-message.is-success {
    background: #C6F6D5;
    color: #22543D;
}

.contact-message.is-error {
    background: #FED7D7;
    color: #742A2A;
}

/* Newsletter Page Form */
.newsletter-page-form {
    margin-top: 2rem;
    max-width: 500px;
}

/* ========================================
   Design Enhancement — Layout Refinements
   ======================================== */

/* Sticky header — frosted glass feel */
.site-header {
    background-color: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header.is-sticky {
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* Site title gradient */
.site-title {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Refined nav links */
.nav-menu a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-mid);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.875rem;
    transition: background-color var(--transition), color var(--transition);
}
.nav-menu a:hover {
    background-color: var(--primary-pale);
    color: var(--primary);
}
.nav-menu .current-menu-item > a {
    background-color: var(--primary-pale);
    color: var(--primary);
    font-weight: 600;
}

/* Blog nav button */
.btn-blog {
    background: var(--primary);
    color: #fff !important;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1rem !important;
    font-weight: 600 !important;
    transition: background-color var(--transition), transform var(--transition);
}
.btn-blog:hover {
    background: var(--primary-hover) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Section titles — refined */
.section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.625rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.025em;
    margin-bottom: 1.75rem;
    position: relative;
    padding-bottom: 0.75rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2.5rem;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 99px;
}

/* Entry content */
.entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-mid);
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 2.25rem;
    margin-bottom: 0.875rem;
    color: var(--text);
}
.entry-content p { margin-bottom: 1.375rem; }
.entry-content a { border-bottom: 1px solid var(--border-hover); }
.entry-content a:hover { border-bottom-color: var(--primary); }

/* Footer */
.site-footer {
    background: #111827;
    color: rgba(255,255,255,0.65);
    border-top: none;
}
.site-footer a {
    color: rgba(255,255,255,0.75);
    transition: color var(--transition);
}
.site-footer a:hover { color: var(--primary-light); }

/* footer-title used in footer-columns.php */
.site-footer .footer-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.site-footer .footer-description {
    color: rgba(255,255,255,0.55);
    font-size: 0.9375rem;
    line-height: 1.6;
}
.site-footer .footer-menu a {
    color: rgba(255,255,255,0.6);
}
.site-footer .footer-menu a:hover {
    color: var(--primary-light);
}
.site-footer .footer-categories li a {
    color: rgba(255,255,255,0.6);
}
.site-footer .footer-categories li a:hover {
    color: var(--primary-light);
}
.site-footer .copyright {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.25rem 0 0;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
}
