/*
Theme Name: David Hoang
Theme URI: https://davidhoang.com
Author: David Hoang
Author URI: https://davidhoang.com
Description: A custom minimalist theme for David Hoang's blog
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: david-hoang
Tags: blog, minimal, clean, custom
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-color: #1a1a1a;
    --bg-color: #ffffff;
    --link-color: #1a1a1a;
    --link-hover: #666666;
    --border-color: #e5e5e5;
    --spacing-unit: 1.5rem;
    --max-width: 800px;
    --font-family: "EB Garamond", Georgia, serif;
    --font-family-serif: "EB Garamond", Georgia, serif;
}

body {
    font-family: var(--font-family);
    font-size: 20px;
    line-height: 1.75;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#page.site {
    margin-top: 0;
    padding-top: 0;
    position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: var(--spacing-unit);
    color: var(--text-color);
    font-family: var(--font-family);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--spacing-unit);
}

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

a:hover {
    color: var(--link-hover);
}

/* Layout */
.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.site-header {
    position: relative;
    margin-bottom: calc(var(--spacing-unit) * 2);
    display: flex;
    justify-content: center;
    padding-top: 24px;
}

/* Navigation */
.main-navigation {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    background: rgba(255, 255, 255, 1.0);
    border-radius: 36px;
    width: auto;
    min-width: 300px;
    padding: 0;
    border: 4px solid rgba(0, 0, 0, 0.08);
    font-size: 1.4rem;
    font-weight: 600;
    color: #000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family-serif);
    overflow: hidden;
}

/* Adjust navigation position when WordPress admin bar is present */
.admin-bar .main-navigation {
    top: calc(32px + 24px); /* Admin bar height (32px) + original top spacing (24px) */
}

.admin-bar .main-navigation:hover {
    top: calc(32px + 22px); /* Slight movement on hover */
}

@media screen and (max-width: 782px) {
    .admin-bar .main-navigation {
        top: calc(46px + 24px); /* Mobile admin bar height (46px) + original top spacing (24px) */
    }
    
    .admin-bar .main-navigation:hover {
        top: calc(46px + 22px); /* Slight movement on hover */
    }
}

@media (hover: hover) {
    .main-navigation:hover {
        top: 22px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.1);
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 12px 24px;
    margin: 0 auto;
    gap: 1rem;
    border-radius: 36px;
}

.main-navigation .logo {
    font-weight: 800;
    text-decoration: none;
    color: #000;
    font-size: 1.2rem;
    opacity: 1;
    height: 100%;
    display: flex;
    align-items: center;
    margin-right: 0;
    position: relative;
}

.main-navigation .nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    height: 100%;
}

.main-navigation .nav-links li {
    height: 100%;
    margin: 0;
    padding: 0;
}

.main-navigation .nav-links a {
    text-decoration: none;
    color: #000;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease, text-decoration-color 0.2s ease;
    font-size: 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    margin: 0;
    position: relative;
    font-weight: 500;
}

.main-navigation .nav-links a:hover,
.main-navigation .nav-links a:focus {
    text-decoration: underline;
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
}

.main-navigation .nav-links .current-menu-item > a,
.main-navigation .nav-links .current_page_item > a {
    text-decoration: underline;
    font-weight: 600;
}

/* Responsive Navigation */
@media (max-width: 520px) {
    .main-navigation {
        min-width: unset;
        width: calc(100% - 32px);
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-navigation {
        min-width: 450px;
        padding: 24px;
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0;
        padding: 0;
        height: 64px;
        min-width: unset;
        border: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 9999;
    }

    .nav-container {
        padding: 0 1rem;
        height: 64px;
    }

    .main-navigation .logo {
        font-size: 1rem;
    }

    .main-navigation .nav-links {
        gap: 0.75rem;
    }

    .main-navigation .nav-links a {
        font-size: 0.9rem;
    }
}

/* Content */
.site-main {
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-top: 24px;
}

.post {
    margin-bottom: calc(var(--spacing-unit) * 3);
    padding-bottom: calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--border-color);
}

.post:last-child {
    border-bottom: none;
}

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

.post-title a {
    color: var(--text-color);
}

.post-title a:hover {
    color: var(--link-hover);
}

.post-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: var(--spacing-unit);
}

.post-featured-image-hero {
    width: 100%;
    margin-top: 24px;
    margin-bottom: calc(var(--spacing-unit) * 3);
    overflow: hidden;
    position: relative;
}

.post-featured-image-hero .site-container {
    max-width: 100%;
    padding: 0;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.post-featured-image-hero .featured-image-hero {
    width: 100%;
    height: 450px;
    min-height: 350px;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Large display constraints */
@media (min-width: 1920px) {
    .post-featured-image-hero .site-container {
        max-width: 1600px;
        margin: 0 auto;
        padding: 0 calc(var(--spacing-unit) * 4);
    }
    
    .post-featured-image-hero .featured-image-hero {
        height: 550px;
    }
}

@media (min-width: 2560px) {
    .post-featured-image-hero .site-container {
        max-width: 2000px;
        padding: 0 calc(var(--spacing-unit) * 6);
    }
    
    .post-featured-image-hero .featured-image-hero {
        height: 650px;
    }
}

@media (max-width: 768px) {
    .post-featured-image-hero .featured-image-hero {
        height: 300px;
        min-height: 250px;
    }
}

.post-featured-image {
    margin: calc(var(--spacing-unit) * 2) 0;
    width: 100%;
}

.post-featured-image .featured-image {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    margin-top: var(--spacing-unit);
}

.post-content p {
    margin-bottom: var(--spacing-unit);
    font-size: 1.125em;
    line-height: 1.8;
}

.post-content img,
.post-content .wp-image,
.post-content .wp-block-image img,
.post-content figure img {
    margin-top: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
    display: block;
    max-width: 100%;
    height: auto;
}

.post-content blockquote {
    margin: calc(var(--spacing-unit) * 2) 0;
    padding-left: calc(var(--spacing-unit) * 2);
    border-left: 3px solid #999;
    font-size: 1.25em;
    line-height: 1.7;
    font-style: italic;
    color: var(--text-color);
    font-family: var(--font-family);
}

.post-content blockquote p {
    margin-bottom: var(--spacing-unit);
    font-size: inherit;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Bullet Point Indentation - High Specificity */
.post-content ul,
.post-content ol,
article .post-content ul,
article .post-content ol,
.single-post .post-content ul,
.single-post .post-content ol,
.wp-block-list ul,
.wp-block-list ol,
.entry-content ul,
.entry-content ol {
    margin-left: 4rem !important;
    margin-bottom: calc(var(--spacing-unit) * 1.5) !important;
    padding-left: 0 !important;
    list-style-position: outside !important;
}

.post-content ul li,
.post-content ol li,
article .post-content ul li,
article .post-content ol li,
.single-post .post-content ul li,
.single-post .post-content ol li,
.post-content ul li.has-medium-font-size,
.post-content ol li.has-medium-font-size,
article .post-content ul li.has-medium-font-size,
article .post-content ol li.has-medium-font-size,
.wp-block-list ul li,
.wp-block-list ol li,
.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.75rem !important;
    padding-left: 0.5rem !important;
    margin-left: 0 !important;
    line-height: 1.4 !important;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

/* Single Post Layout */
.single-post-container {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: calc(var(--spacing-unit) * 3);
    align-items: start;
}

.content-wrapper {
    min-width: 0;
}

.single-post .post {
    border-bottom: none;
    padding-bottom: 0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: calc(var(--spacing-unit) * 2);
    font-size: 1rem;
    line-height: 1.6;
}

.sidebar-section {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.sidebar-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

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

.sidebar-list li {
    margin-bottom: 0.25rem;
}

.sidebar-list a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s ease;
}

.sidebar-list a:hover {
    text-decoration-color: var(--text-color);
}

.sidebar-link {
    color: var(--text-color);
    text-decoration: underline;
}

.sidebar-email {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

.sidebar-footer {
    margin-top: calc(var(--spacing-unit) * 3);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--border-color);
}

.sidebar-copyright {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.sidebar-quote {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Post Footer */
.post-footer {
    margin-top: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

/* Comments Section */
.comments-area {
    margin-top: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 4);
    padding-top: calc(var(--spacing-unit) * 3);
    border-top: 1px solid var(--border-color);
}

.comments-title,
.comment-reply-title {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: calc(var(--spacing-unit) * 3);
    margin-top: 0;
    font-family: var(--font-family);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-title-post {
    font-size: 1rem;
    font-weight: normal;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-title-arrow {
    color: #666;
}

.comments-title-post-name {
    color: #666;
}

/* Comment List */
.comment-list {
    list-style: none;
    margin: 0 0 calc(var(--spacing-unit) * 3) 0;
    padding: 0;
    counter-reset: none;
}

.comment-list li {
    list-style: none;
    counter-increment: none;
}

.comment-list > li {
    margin-bottom: calc(var(--spacing-unit) * 3);
    padding-bottom: 0;
}

.comment-list > li:last-child {
    margin-bottom: 0;
}

.comment-body {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
    margin-bottom: 0;
    position: relative;
}

.comment-author {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.comment-author .avatar {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: block;
}

.comment-content-wrapper {
    flex: 1;
    position: relative;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--text-color);
}

.comment-content-wrapper::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid var(--text-color);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author-name {
    font-weight: 600;
    font-style: normal;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.comment-author-name a {
    color: var(--text-color);
    text-decoration: none;
}

.comment-metadata {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    font-weight: normal;
}

.comment-metadata a {
    color: #666;
    text-decoration: none;
}

.comment-content {
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    color: var(--text-color);
    line-height: 1.7;
}

.comment-content p {
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    font-size: 1em;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--spacing-unit) * 0.5);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-footer .edit-link {
    font-size: 0.875rem;
    color: var(--text-color);
    text-decoration: none;
}

.comment-footer .edit-link a {
    color: var(--text-color);
    text-decoration: none;
}

.comment-reply-link {
    font-size: 0.875rem;
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-style: dotted;
    display: inline-block;
    font-weight: normal;
}

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

.comment-awaiting-moderation {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
    margin-bottom: calc(var(--spacing-unit) * 0.75);
}

.comment-navigation {
    margin: calc(var(--spacing-unit) * 3) 0;
    padding: calc(var(--spacing-unit) * 2) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.comment-navigation .nav-previous,
.comment-navigation .nav-next {
    font-size: 0.875rem;
}

.comment-navigation a {
    color: var(--text-color);
    text-decoration: none;
}

.comment-navigation a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.no-comments {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
    margin: calc(var(--spacing-unit) * 2) 0;
}

/* Comment Form */
#respond {
    margin-top: calc(var(--spacing-unit) * 4);
    padding-top: calc(var(--spacing-unit) * 3);
    border-top: 1px solid var(--border-color);
}

.comment-form {
    margin-top: calc(var(--spacing-unit) * 2);
}

.comment-form p {
    margin-bottom: var(--spacing-unit);
    font-family: var(--font-family);
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-color);
}

.comment-form p a {
    color: var(--text-color);
    text-decoration: underline;
}

.comment-form p a:hover {
    color: var(--link-hover);
}

.comment-form p.logged-in-as {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: normal;
    font-size: 1em;
    font-family: var(--font-family);
    color: var(--text-color);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: border-color 0.2s ease;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #999;
}

.comment-form textarea {
    min-height: 150px;
    resize: both;
    font-family: var(--font-family);
}

.comment-form input[type="submit"] {
    padding: 0.75rem 1.5rem;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    margin-top: var(--spacing-unit);
}

.comment-form input[type="submit"]:hover {
    background-color: #222;
}

.comment-form input[type="submit"]:active {
    background-color: #111;
}

.comment-form .form-submit {
    margin-top: var(--spacing-unit);
}

/* Nested Comments */
.comment-list .children {
    list-style: none;
    margin: calc(var(--spacing-unit) * 2) 0 0 calc(var(--spacing-unit) * 3);
    padding: 0;
}

.comment-list .children .comment-body {
    gap: calc(var(--spacing-unit) * 1.5);
}

.comment-list .children .comment-author .avatar {
    width: 50px;
    height: 50px;
}

/* Footer */
.site-footer {
    margin-top: calc(var(--spacing-unit) * 4);
    padding: calc(var(--spacing-unit) * 2) 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: #666;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .single-post-container {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 2);
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-unit: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .site-header {
        padding: var(--spacing-unit) 0;
    }
    
    .single-post-container {
        gap: var(--spacing-unit);
    }
}

/* WordPress Core Styles */
.alignleft {
    float: left;
    margin: 0 var(--spacing-unit) var(--spacing-unit) 0;
}

.alignright {
    float: right;
    margin: 0 0 var(--spacing-unit) var(--spacing-unit);
}

.aligncenter {
    display: block;
    margin: 0 auto var(--spacing-unit);
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}
