/*
Theme Name: Rudi Hartono
Theme URI: https://example.com/rudi-hartono
Author: Yu Shen / Googlebaike Project
Author URI: https://example.com
Description: A clean Western personal-blog theme for Rudi Hartono — investment research and AI fintech profile. English default with Traditional Chinese (zh-Hant) front-end language toggle. SEO-ready (meta, Open Graph, JSON-LD Person). Self-contained; no paid plugins required.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
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: rudi-hartono
Tags: blog, custom-logo, custom-menu, featured-images, translation-ready, one-column
*/

/* ==========================================================================
   Design tokens — cool slate editorial (light, not purple / cream-terracotta)
   ========================================================================== */
:root {
  --rh-ink: #1a2332;
  --rh-ink-soft: #3d4a5c;
  --rh-muted: #5c6b7a;
  --rh-line: #c8d0da;
  --rh-paper: #f7f5f1;
  --rh-paper-deep: #ebe6dc;
  --rh-accent: #1e5a7a;
  --rh-accent-hover: #164860;
  --rh-sea: #2a6f8f;
  --rh-mist: rgba(42, 111, 143, 0.08);
  --rh-glow: rgba(30, 90, 122, 0.12);
  --rh-serif: "Newsreader", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --rh-sans: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --rh-mono: "IBM Plex Mono", ui-monospace, monospace;
  --rh-max: 42rem;
  --rh-wide: 68rem;
  --rh-radius: 2px;
  --rh-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Reset / base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--rh-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--rh-ink);
  background-color: var(--rh-paper);
  background-image:
    radial-gradient(ellipse 120% 80% at 10% -20%, var(--rh-glow), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(42, 111, 143, 0.07), transparent 50%),
    linear-gradient(180deg, #faf8f4 0%, var(--rh-paper) 40%, var(--rh-paper-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--rh-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--rh-ease);
}

a:hover,
a:focus-visible {
  color: var(--rh-accent-hover);
}

:focus-visible {
  outline: 2px solid var(--rh-sea);
  outline-offset: 3px;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.rh-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--rh-ink);
  color: #fff;
}

.rh-skip:focus {
  left: 1rem;
  top: 1rem;
}

.rh-wrap {
  width: min(100% - 2.5rem, var(--rh-wide));
  margin-inline: auto;
}

.rh-wrap--narrow {
  width: min(100% - 2.5rem, var(--rh-max));
}

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
  padding: 1.25rem 0 0.5rem;
  position: relative;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.custom-logo-link img {
  width: auto;
  height: 2.5rem;
}

.site-title {
  margin: 0;
  font-family: var(--rh-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.site-title a {
  color: var(--rh-ink);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--rh-accent);
}

.site-description {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--rh-muted);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.primary-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.primary-menu a {
  color: var(--rh-ink-soft);
  text-decoration: none;
  font-weight: 500;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--rh-accent);
}

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--rh-line);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lang-toggle__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--rh-muted);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  line-height: 1;
}

.lang-toggle__btn:hover {
  color: var(--rh-ink);
}

.lang-toggle__btn.is-active {
  background: var(--rh-ink);
  color: #fff;
}

.lang-toggle__btn + .lang-toggle__btn {
  border-left: 1px solid var(--rh-line);
}

/* ==========================================================================
   Hero (front page) — brand + portrait as visual anchor
   ========================================================================== */
.hero {
  padding: clamp(2.75rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 5% -5% auto 35%;
  height: 80%;
  background:
    radial-gradient(ellipse at center, rgba(30, 90, 122, 0.14), transparent 70%);
  pointer-events: none;
  animation: rh-drift 18s ease-in-out infinite alternate;
}

@keyframes rh-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4%, 6%) scale(1.08); }
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}

.hero__copy {
  max-width: 36rem;
}

.hero__name {
  margin: 0 0 1rem;
  font-family: var(--rh-serif);
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--rh-ink);
  opacity: 0;
  animation: rh-rise 0.9s var(--rh-ease) 0.1s forwards;
}

.hero__lede {
  margin: 0 0 1.75rem;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--rh-ink-soft);
  max-width: 32rem;
  opacity: 0;
  animation: rh-rise 0.9s var(--rh-ease) 0.28s forwards;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  opacity: 0;
  animation: rh-rise 0.9s var(--rh-ease) 0.45s forwards;
}

.hero__portrait {
  margin: 0;
  position: relative;
  opacity: 0;
  animation: rh-rise 1s var(--rh-ease) 0.2s forwards;
}

.hero__portrait img {
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
  aspect-ratio: 1279 / 1224;
  object-fit: cover;
  object-position: center 18%;
  border-radius: var(--rh-radius);
  filter: contrast(1.02) saturate(0.96);
  box-shadow: none;
}

@keyframes rh-rise {
  from {
    opacity: 0;
    transform: translateY(0.85rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  font-family: var(--rh-sans);
  font-size: 0.9rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--rh-ease), color 0.2s var(--rh-ease), border-color 0.2s var(--rh-ease);
}

.btn--primary {
  background: var(--rh-accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--rh-accent-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--rh-line);
  color: var(--rh-ink-soft);
}

.btn--ghost:hover {
  border-color: var(--rh-accent);
  color: var(--rh-accent);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: 2.75rem 0;
}

.section + .section {
  border-top: 1px solid var(--rh-line);
}

.section__title {
  margin: 0 0 1.25rem;
  font-family: var(--rh-serif);
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  color: var(--rh-ink);
}

.section__intro {
  margin: -0.5rem 0 1.5rem;
  color: var(--rh-muted);
  max-width: 36rem;
}

.prose {
  max-width: var(--rh-max);
}

.prose p {
  margin: 0 0 1.15rem;
}

.prose h2,
.prose h3 {
  font-family: var(--rh-serif);
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  color: var(--rh-ink);
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.2rem;
}

.prose ul {
  margin: 0 0 1.15rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose .note {
  font-size: 0.92rem;
  color: var(--rh-muted);
  border-left: 2px solid var(--rh-line);
  padding-left: 1rem;
  margin: 1.5rem 0;
}

/* ==========================================================================
   Posts list
   ========================================================================== */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list__item {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rh-line);
}

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

.post-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--rh-muted);
  letter-spacing: 0.02em;
}

.post-list__title {
  margin: 0 0 0.4rem;
  font-family: var(--rh-serif);
  font-size: 1.35rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.post-list__title a {
  color: var(--rh-ink);
  text-decoration: none;
}

.post-list__title a:hover {
  color: var(--rh-accent);
}

.post-list__excerpt {
  margin: 0;
  color: var(--rh-ink-soft);
  font-size: 0.98rem;
}

.empty-state {
  color: var(--rh-muted);
  font-size: 0.98rem;
}

/* ==========================================================================
   Single / page content
   ========================================================================== */
.site-main {
  padding: 2rem 0 4rem;
}

.entry-header {
  margin-bottom: 1.75rem;
  max-width: var(--rh-max);
}

.entry-title {
  margin: 0 0 0.75rem;
  font-family: var(--rh-serif);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.entry-meta {
  font-size: 0.85rem;
  color: var(--rh-muted);
}

.entry-content {
  max-width: var(--rh-max);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-thumbnail {
  margin: 0 0 1.75rem;
  max-width: var(--rh-wide);
}

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

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rh-line);
  font-size: 0.9rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--rh-line);
  margin-top: auto;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--rh-muted);
}

.site-footer a {
  color: var(--rh-ink-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--rh-accent);
}

/* ==========================================================================
   Widgets / sidebar (optional)
   ========================================================================== */
.widget-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rh-line);
}

.widget {
  margin-bottom: 1.75rem;
}

.widget-title {
  font-family: var(--rh-serif);
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

/* ==========================================================================
   Alignments / WP blocks
   ========================================================================== */
.alignwide {
  max-width: var(--rh-wide);
}

.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.wp-block-image img {
  height: auto;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__portrait {
    order: -1;
    max-width: 22rem;
    margin-inline: auto;
    width: 100%;
  }

}

@media (max-width: 640px) {
  .site-header__inner {
    align-items: flex-start;
  }

  .primary-menu {
    width: 100%;
  }

  .hero {
    padding-top: 2.25rem;
  }

  .hero__portrait {
    max-width: 16rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__name,
  .hero__lede,
  .hero__actions,
  .hero__portrait,
  .hero::before {
    animation: none;
    opacity: 1;
  }
}
