/* ============================================
   LINTAR.MY.ID — Cozy Doodle Theme
   Warm + hand-drawn sketchy vibes + dark mode
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Newsreader:ital,wght@0,400;0,600;0,700;1,400&family=Caveat:wght@400;500;600;700&display=swap');

/* ── Light Mode ── */
:root {
    --bg: #faf8f5;
    --bg-alt: #f3f0eb;
    --surface: #ffffff;
    --border: #e8e4de;
    --border-strong: #d4cfc7;
    --text: #2c2825;
    --text-soft: #7a7167;
    --accent: #c96442;
    --accent-hover: #b05535;
    --doodle: #c96442;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-hand: 'Caveat', cursive;
    --radius: 6px;
    --max-w: 720px;
    --max-w-wide: 1060px;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --bg: #1a1816;
    --bg-alt: #221f1c;
    --surface: #2a2622;
    --border: #3a3530;
    --border-strong: #4a443d;
    --text: #e8e2d9;
    --text-soft: #9a9188;
    --accent: #e0815e;
    --accent-hover: #eba080;
    --doodle: #e0815e;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.7;
    transition: background 0.3s, color 0.3s;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── SVG Icons ── */
.icon-sm {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-star {
    vertical-align: -2px;
    color: var(--accent);
}

.icon-heart {
    vertical-align: -1px;
    color: var(--accent);
}

img {
    display: block;
    max-width: 100%;
}

.wrap {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 28px;
}

.wrap-wide {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 28px;
}

/* ── Doodle Elements ── */
.doodle-star {
    display: inline-block;
    color: var(--doodle);
    font-size: 1.2em;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9) rotate(10deg);
    }
}

.doodle-underline {
    position: relative;
    display: inline;
}

.doodle-underline::after {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    bottom: -4px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8'%3E%3Cpath d='M0 4 Q10 0 20 4 Q30 8 40 4 Q50 0 60 4 Q70 8 80 4 Q90 0 100 4 Q110 8 120 4' fill='none' stroke='%23c96442' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
    background-size: 60px 8px;
}

[data-theme="dark"] .doodle-underline::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8'%3E%3Cpath d='M0 4 Q10 0 20 4 Q30 8 40 4 Q50 0 60 4 Q70 8 80 4 Q90 0 100 4 Q110 8 120 4' fill='none' stroke='%23e0815e' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
    background-size: 60px 8px;
}

.doodle-arrow {
    display: inline-block;
    color: var(--doodle);
    font-family: var(--font-hand);
    font-size: 1.3rem;
}

.doodle-note {
    font-family: var(--font-hand);
    color: var(--accent);
    font-size: 1.1rem;
}

.doodle-circle {
    position: relative;
}

.doodle-circle::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -8px;
    right: -8px;
    bottom: -6px;
    border: 2px dashed var(--doodle);
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
}

.wavy-sep {
    text-align: center;
    padding: 20px 0;
    color: var(--border-strong);
    font-size: 1.2rem;
    letter-spacing: 6px;
    user-select: none;
}

/* ── Header ── */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.site-logo {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-doodle {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 8px;
}

.nav-link {
    font-size: 0.78rem;
    color: var(--text-soft);
    font-weight: 500;
    transition: color 0.15s;
}

.nav-link:hover {
    color: var(--text);
}

.theme-toggle {
    width: 34px;
    height: 34px;
    border: 2px dashed var(--border-strong);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-soft);
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.search-btn {
    width: 34px;
    height: 34px;
    border: 2px dashed var(--border-strong);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-soft);
}

.search-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.search-btn svg {
    width: 14px;
    height: 14px;
}

.mobile-menu-btn {
    display: none;
    width: 34px;
    height: 34px;
    border: 2px dashed var(--border-strong);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.mobile-menu-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Mobile Menu Overlay ── */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 9999;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="dark"] .mobile-menu-overlay {
    background: rgba(26, 24, 22, 0.95);
    backdrop-filter: blur(10px);
}

.mobile-menu-close {
    position: absolute;
    top: 28px;
    right: 28px;
    background: none;
    border: none;
    color: var(--text-soft);
    cursor: pointer;
}

.mobile-menu-close svg {
    width: 32px;
    height: 32px;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.mobile-nav-link {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-nav-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 6px;
}

.theme-toggle svg {
    width: 15px;
    height: 15px;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* ── Hero ── */
.hero {
    padding: 56px 0 44px;
    position: relative;
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 8px;
}

.hero-text {
    flex: 1;
}

.hero-avatar {
    flex-shrink: 0;
    position: relative;
}

.hero-avatar img {
    width: 140px;
    height: 140px;
    border-radius: var(--radius);
    border: 3px dashed var(--accent);
    padding: 4px;
    background: var(--surface);
    object-fit: cover;
    object-position: top;
    filter: grayscale(0.4) sepia(0.3) contrast(1.15) saturate(0.7) brightness(1.05);
    transition: filter 0.4s ease, transform 0.3s ease;
}

.hero-avatar:hover img {
    filter: grayscale(0) sepia(0) contrast(1) saturate(1) brightness(1);
    transform: scale(1.05);
}

.hero-avatar:hover::before {
    border-color: var(--accent-hover);
}

.hero-avatar:hover img {
    transform: scale(1.05);
    transition: transform 0.3s;
}

.hero-greeting {
    font-family: var(--font-hand);
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.hero-desc {
    font-size: 0.92rem;
    color: var(--text-soft);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.hero-desc .hand-note {
    font-family: var(--font-hand);
    color: var(--accent);
    font-size: 1.1em;
}

.hero-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.topic-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px dashed var(--border-strong);
    color: var(--text-soft);
    transition: all 0.15s;
    position: relative;
}

.topic-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hero-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1.5px dashed var(--accent);
    color: var(--accent);
    transition: all 0.2s;
}

.hero-link-btn:hover {
    background: var(--accent);
    color: #fff;
    border-style: solid;
}

.subscribe-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscribe-form {
    display: flex;
    gap: 6px;
}

.subscribe-form input {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    outline: none;
    width: 210px;
    transition: border-color 0.15s, background 0.3s, color 0.3s;
}

.subscribe-form input:focus {
    border-color: var(--accent);
}

.subscribe-form input::placeholder {
    color: var(--text-soft);
}

.subscribe-form button {
    padding: 9px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s;
}

.subscribe-form button:hover {
    background: var(--accent-hover);
}

/* ── Tag Bar ── */
.tag-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0 0;
    flex-wrap: wrap;
}

.tag-bar-label {
    color: var(--text-soft);
    display: flex;
    align-items: center;
}

.tag-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px dashed var(--border-strong);
    color: var(--text-soft);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tag-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
}

.tag-count {
    font-size: 0.58rem;
    opacity: 0.5;
}

/* ── Section Header ── */
.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 36px 0 20px;
}

.section-header h2 {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.section-header .line-grow {
    flex: 1;
    height: 0;
    border-top: 2px dashed var(--border);
}

/* ── Card Grid ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    background: var(--surface);
    border: 1.5px dashed var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: var(--accent);
    border-style: solid;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px dashed var(--border);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-image-empty {
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-icon {
    font-size: 2rem;
    color: var(--border-strong);
}

.card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.65rem;
}

.card-tag {
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-date {
    color: var(--text-soft);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
    transition: color 0.15s;
}

.card:hover .card-title {
    color: var(--accent);
}

.card-excerpt {
    font-size: 0.78rem;
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
    margin-bottom: 12px;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.62rem;
    color: var(--text-soft);
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    margin-top: auto;
}

.card-footer .dot {
    opacity: 0.4;
}

.card-author-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px dashed var(--border-strong);
}

.card-author-name {
    font-weight: 500;
}

/* ── Post Detail ── */
.post-header {
    padding: 48px 0 28px;
    position: relative;
}

.post-header-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 14px;
}

.post-header-excerpt {
    font-size: 1.05rem;
    color: var(--text-soft);
    line-height: 1.5;
    margin-bottom: 20px;
}

.author-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    padding-bottom: 24px;
    border-bottom: 2px dashed var(--border);
}

.author-row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px dashed var(--border-strong);
}

.author-row-name {
    font-weight: 600;
    display: block;
}

.author-row-meta {
    color: var(--text-soft);
    font-size: 0.7rem;
}

.post-feature-image {
    margin: 32px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px dashed var(--border-strong);
}

.post-feature-image img {
    width: 100%;
    display: block;
}

.post-body {
    padding-bottom: 48px;
    border-bottom: 2px dashed var(--border);
}

.post-content {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}

/* ── Ghost Koenig Editor Cards ── */
.kg-width-wide {
    margin-left: -60px;
    margin-right: -60px;
}

.kg-width-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

.kg-image-card,
.kg-embed-card {
    margin: 1.5em 0;
}

.kg-image-card img {
    margin: 0 auto;
}

.kg-image-card figcaption,
.kg-embed-card figcaption {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-top: 8px;
    font-family: var(--font-sans);
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    margin: 1.5em 0;
}

.kg-gallery-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px dashed var(--border-strong);
}

.kg-bookmark-card {
    margin: 1.5em 0;
}

.kg-bookmark-container {
    display: flex;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

.kg-bookmark-container:hover {
    border-color: var(--accent);
}

.kg-bookmark-content {
    flex: 1;
    padding: 16px;
}

.kg-bookmark-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.kg-bookmark-description {
    font-size: 0.75rem;
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.68rem;
    color: var(--text-soft);
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 160px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2em 0 0.5em;
    padding-top: 0.5em;
    border-top: 1px dashed var(--border);
}

.post-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.5em 0 0.4em;
}

.post-content p {
    margin-bottom: 1.4em;
}

.post-content img {
    border-radius: var(--radius);
    margin: 1.5em 0;
    border: 2px dashed var(--border-strong);
}

.post-content code {
    font-size: 0.85em;
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px dashed var(--border);
    transition: background 0.3s;
}

.post-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-size: 0.82rem;
    line-height: 1.7;
    border: 2px dashed var(--border-strong);
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 3px;
}

.post-content blockquote {
    border-left: 3px dashed var(--accent);
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--text-soft);
}

.post-content ul,
.post-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.post-content li {
    margin-bottom: 0.4em;
}

.post-content hr {
    border: none;
    text-align: center;
    margin: 2.5em 0;
}

.post-content hr::before {
    content: '~ ~ ~';
    font-family: var(--font-hand);
    color: var(--accent);
    font-size: 1.2rem;
    letter-spacing: 6px;
}

.post-tags {
    padding: 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-tags a {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px dashed var(--border-strong);
    color: var(--text-soft);
    transition: all 0.15s;
}

.post-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
}

/* ── Footer ── */
.site-footer {
    border-top: 2px dashed var(--border-strong);
    padding: 24px 0;
    background: var(--bg);
    transition: background 0.3s;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-soft);
}

.footer-hand {
    font-family: var(--font-hand);
    font-size: 1rem;
    color: var(--accent);
}

/* ── Pagination ── */
.pagination {
    padding: 28px 0;
    text-align: center;
}

.pagination a {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    padding: 7px 16px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 20px;
    transition: all 0.15s;
}

.pagination a:hover {
    border-style: solid;
    background: var(--accent);
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 40px 0 28px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-top {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 20px;
    }

    .hero-avatar img {
        width: 80px;
        height: 80px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .site-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .subscribe-form input {
        width: 100%;
    }
}