/*
Theme Name: Clarity
Theme URI: https://akashjagdhale.com
Author: Akash Jagdhale
Author URI: https://akashjagdhale.com
Description: A minimal, dark, text-focused WordPress theme. No images. No noise.
Version: 2.0.0
Requires at least: 5.9
Tested up to: 6.9
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: clarity
Tags: blog, custom-menu, translation-ready
*/

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #1a1a1a;
    color: #d4d4d4;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(15px, 1.1vw + 12px, 17px);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-family: 'Alata', sans-serif; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

::selection {
    background: rgba(212,119,59,0.25);
    color: #fff;
}

/* ── HEADER ── */
.site-header {
    padding: clamp(14px, 3vw, 28px) 5vw;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header-left a {
    font-family: 'Alata', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    font-weight: 700;
    color: #D4773B;
    letter-spacing: 0.01em;
}

.site-header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-header-nav ul {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.site-header-nav ul li a {
    font-size: 0.9rem;
    color: #888;
    transition: color 0.2s;
}

.site-header-nav ul li a:hover {
    color: #fff;
}

.site-header-nav ul li.current-menu-item > a,
.site-header-nav ul li.current_page_item > a {
    color: #fff;
}

/* ── MAIN CONTAINER ── */
.site-main {
    width: 90%;
    max-width: 780px;
    min-width: 300px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 40px) 0 clamp(48px, 6vw, 80px);
}

/* ── HOME INTRO ── */
.home-intro {
    padding-bottom: clamp(32px, 5vw, 56px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: clamp(28px, 5vw, 56px);
}

.home-intro h1 {
    font-family: 'Alata', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1.2;
    margin-bottom: 16px;
}

.home-intro h1 em {
    font-style: normal;
    color: #D4773B;
}

.home-intro p {
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: #999;
    max-width: 560px;
    line-height: 1.75;
}

/* ── POST LIST ── */
.posts-list {
    display: flex;
    flex-direction: column;
}

.post-item {
    padding: clamp(28px, 5vw, 48px) 0 0;
}

.post-item:first-child {
    padding-top: 0;
}

.post-meta {
    font-size: 0.78rem;
    color: #666;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.post-title {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 700;
    line-height: 1.5;
}

.post-title a {
    color: #fff;
    transition: color 0.2s;
}

.post-title a:hover {
    color: #D4773B;
}

.post-excerpt {
    margin-top: 8px;
    font-size: clamp(0.88rem, 1.2vw, 1rem);
    color: #999;
    line-height: 1.75;
}

/* ── ALL POSTS LINK ── */
.all-posts-link {
    display: inline-block;
    margin-top: 32px;
    color: #666;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.all-posts-link:hover {
    color: #d4d4d4;
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    gap: 14px;
    margin-top: 40px;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination .page-numbers {
    color: #888;
    transition: color 0.2s;
    text-decoration: none;
}

.pagination a:hover {
    color: #fff;
}

.pagination .current {
    color: #d4d4d4;
    font-weight: 600;
}

/* ── SINGLE POST ── */
.single-post {
    padding-top: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 28px;
    font-size: 0.88rem;
    color: #666;
    transition: color 0.2s;
}

.back-link:hover {
    color: #d4d4d4;
}

.single-post h1 {
    font-family: 'Alata', sans-serif;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1.35;
    margin-bottom: 8px;
}

.single-post .post-meta {
    margin-bottom: 36px;
}

/* ── ENTRY CONTENT ── */
.entry-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #c8c8c8;
}

.entry-content p {
    margin-bottom: 1.4em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: 'Alata', sans-serif;
    color: #f0f0f0;
    margin: 1.8em 0 0.6em;
    font-weight: 600;
}

.entry-content h2 { font-size: 1.4em; }
.entry-content h3 { font-size: 1.2em; }
.entry-content h4 { font-size: 1.05em; }

.entry-content a {
    color: #D4773B;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s;
}

.entry-content a:hover {
    color: #E8884A;
}

.entry-content strong {
    color: #e0e0e0;
    font-weight: 600;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.4em;
    padding-left: 24px;
}

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

.entry-content li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.entry-content blockquote {
    margin: 1.6em 0;
    padding: 16px 24px;
    border-left: 3px solid #D4773B;
    color: #bbb;
    font-style: italic;
}

.entry-content blockquote p {
    margin-bottom: 0;
}

.entry-content pre {
    background: #222;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 1.4em;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.88em;
    line-height: 1.6;
    color: #d4d4d4;
}

.entry-content code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.88em;
    background: #222;
    padding: 2px 6px;
    border-radius: 4px;
    color: #D4773B;
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border-radius: 0;
}

.entry-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 2em 0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.2em 0;
}

.entry-content figure {
    margin: 1.6em 0;
}

.entry-content figcaption {
    text-align: center;
    font-size: 0.82rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4em;
    font-size: 0.95em;
}

.entry-content table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    font-size: 0.8em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
}

.entry-content table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── POST NAVIGATION ── */
.post-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.92rem;
}

.post-nav a {
    color: #888;
    transition: color 0.2s;
}

.post-nav a:hover {
    color: #fff;
}

/* ── PAGE HERO ── */
.page-hero {
    padding-bottom: clamp(32px, 5vw, 56px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: clamp(32px, 5vw, 56px);
}

.page-greeting {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: #888;
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.page-name {
    font-family: 'Alata', sans-serif;
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.page-tagline {
    font-size: clamp(0.95rem, 1.3vw, 1.08rem);
    color: #777;
    line-height: 1.7;
    max-width: 480px;
    letter-spacing: 0.02em;
}

/* ── PAGE BODY ── */
.page-body {
    max-width: 640px;
}

.page-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #bbb;
    margin-bottom: 36px;
}

.page-cta {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.page-cta a {
    color: #D4773B;
    transition: color 0.2s;
}

.page-cta a:hover {
    color: #E8884A;
}

/* ── CONTACT FORM ── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #d4d4d4;
    margin-bottom: 6px;
}

.form-input,
.form-input[type="text"],
.form-input[type="email"],
textarea.form-input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: #d4d4d4;
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

.form-input:focus {
    border-color: #D4773B;
}

.form-input::placeholder {
    color: #555;
}

.btn-submit {
    display: inline-block;
    padding: 12px 28px;
    background: #D4773B;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #E8884A;
}

.contact-alt {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem;
    color: #888;
}

.contact-alt a {
    color: #D4773B;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-alt a:hover {
    color: #E8884A;
}

.form-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.form-notice--success {
    background: rgba(34,197,94,0.10);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.2);
}

.form-notice--error {
    background: rgba(239,68,68,0.10);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.2);
}

/* ── BOOK LIST ── */
.book-list {
    display: flex;
    flex-direction: column;
}

.book-item {
    padding: 24px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.book-item:first-child {
    padding-top: 0;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 2px;
}

.book-author {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.book-note {
    font-size: 0.92rem;
    color: #999;
    line-height: 1.7;
}

/* ── COMMENTS ── */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.comments-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 24px;
}

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

.comment {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.comment .fn {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d4d4d4;
}

.comment .comment-metadata a {
    font-size: 0.78rem;
    color: #666;
}

.comment-body p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #999;
    margin-top: 8px;
}

.reply a {
    font-size: 0.8rem;
    color: #D4773B;
    transition: color 0.2s;
}

.reply a:hover {
    color: #E8884A;
}

.children {
    list-style: none;
    padding-left: 24px;
    border-left: 1px solid rgba(255,255,255,0.06);
}

.comment-respond {
    margin-top: 32px;
}

.comment-reply-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #d4d4d4;
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: #d4d4d4;
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 14px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #D4773B;
}

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

.form-submit input[type="submit"] {
    background: #D4773B;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* ── SEARCH FORM ── */
.search-form {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #d4d4d4;
    font-size: 0.92rem;
    outline: none;
}

.search-form input[type="search"]:focus {
    border-color: #D4773B;
}

.search-form button[type="submit"] {
    background: #D4773B;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button[type="submit"]:hover {
    background: #E8884A;
}

.no-results {
    color: #888;
    font-size: 0.95rem;
}

/* ── SUBSCRIBE PAGE ── */
.subscribe-page h1 {
    font-family: 'Alata', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 12px;
}

.subscribe-desc {
    color: #999;
    margin-bottom: 24px;
    line-height: 1.7;
}

.subscribe-no-spam {
    margin-top: 16px;
    font-size: 0.82rem;
    color: #555;
}

/* ── WORDPRESS BLOCKS ── */
.wp-block-image { margin: 1.4em 0; }
.wp-block-image img { border-radius: 6px; }
.wp-block-image figcaption {
    text-align: center;
    font-size: 0.82rem;
    color: #666;
    margin-top: 8px;
}

.wp-block-separator {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 2em 0;
}

.wp-block-pullquote {
    border-top: 2px solid #D4773B;
    border-bottom: 2px solid #D4773B;
    padding: 24px 0;
    text-align: center;
    margin: 1.6em 0;
}

.wp-block-pullquote blockquote p {
    font-size: 1.2em;
    font-style: italic;
    color: #d4d4d4;
}

.wp-block-button .wp-block-button__link {
    display: inline-block;
    background: #D4773B;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.2s;
}

.wp-block-button .wp-block-button__link:hover {
    background: #E8884A;
}

/* ── UTILITY ── */
.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── FOOTER ── */
.site-footer {
    padding: 40px 0 48px;
    text-align: center;
}

.site-footer-inner {
    font-size: 0.8rem;
    color: #444;
    letter-spacing: 0.02em;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .site-header-nav ul { gap: 12px; }
    .site-header-nav ul li a { min-height: 44px; display: flex; align-items: center; }
}

@media print {
    .site-header, .site-footer { display: none; }
    body { background: #fff !important; color: #000 !important; }
    .entry-content, .entry-content p, .entry-content h2, .entry-content h3 { color: #000 !important; }
}

/* ── ARCHIVE HEADING ── */
.archive-heading {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 32px;
    margin-top: 0;
}

/* ── YEAR GROUPS (ACCORDION) ── */
.year-group {
    margin-bottom: 8px;
}

.year-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.year-toggle::-webkit-details-marker { display: none; }

.year-toggle::before {
    content: '▶';
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    transition: transform 0.2s;
    flex-shrink: 0;
}

details[open] > .year-toggle::before {
    transform: rotate(90deg);
    color: rgba(255,255,255,0.6);
}

.year-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.06em;
    transition: color 0.2s;
}

details[open] .year-label {
    color: #fff;
}

.year-count {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.25);
    margin-left: auto;
}

.year-posts {
    padding-bottom: 12px;
}

.year-posts .post-item:first-child {
    padding-top: 0;
}

.archive-loading {
    color: rgba(255,255,255,0.3);
}

/* ── ARCHIVE SEARCH ── */
.archive-search-wrap {
    margin-bottom: 40px;
}

.archive-search-input {
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    color: #d4d4d4;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.archive-search-input::placeholder {
    color: #444;
}

.archive-search-input:focus {
    border-bottom-color: rgba(255,255,255,0.3);
}

.archive-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: url(data:image/svg+xml,%3Csvg xmlns=http://www.w3.org/2000/svg viewBox=0 0 14 14%3E%3Cpath d=M1 1l12 12M13 1L1 13 stroke=%23666 stroke-width=1.5 stroke-linecap=round/%3E%3C/svg%3E) no-repeat center;
    cursor: pointer;
    opacity: 1;
}

mark {
    background: transparent;
    color: #D4773B;
    font-style: normal;
}
