/*
Theme Name: Nytatonic
Theme URI: https://nyta.co
Author: Lasse Jellum
Author URI: https://jellum.net
Description: A taoist classic theme for Nyta. Clean HTML, minimal CSS, zero bloat.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nytatonic
*/

:root {
  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --line-height-base: 1.6;
  --line-height-heading: 1.2;
  
  /* Spacing */
  --space-unit: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --space-xs: calc(var(--space-unit) * 0.5);
  --space-sm: calc(var(--space-unit) * 0.75);
  --space-md: var(--space-unit);
  --space-lg: calc(var(--space-unit) * 1.5);
  --space-xl: calc(var(--space-unit) * 2.5);

  /* Layout */
  --width-content: 42rem;
  --width-wide: 72rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  
  /* Colors */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-primary: #2d5016;
  --color-secondary: #4a7c23;
  --color-border: #e5e5e5;
  --color-border-hover: #d4d4d4;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
}

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

/* Typography */
h1, h2, h3, h4 {
  line-height: var(--line-height-heading);
  margin-block: var(--space-lg) var(--space-sm);
  font-weight: 600;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem); }

p, ul, ol { margin-block: var(--space-md); }

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

a:hover {
  color: var(--color-secondary);
  text-decoration-color: var(--color-secondary);
}

/* Layout Containers */
.container {
  width: min(100% - var(--space-md) * 2, var(--width-content));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - var(--space-md) * 2, var(--width-wide));
  margin-inline: auto;
}

/* Header */
.site-header {
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-logo .logo {
  height: 2.25rem;
  width: auto;
}

.site-nav {
  display: flex;
  gap: var(--space-md);
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--color-primary);
}

/* Main Content */
main {
  padding-block: var(--space-xl);
}

/* Footer */
.site-footer {
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
  border: 1px solid transparent;
}

.btn:hover {
  background: var(--color-secondary);
  color: #fff;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

/* Link Cards */
.link-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  margin-block: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.link-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
}

.link-card strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.link-card span {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Contact Links Specifics */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-link {
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
}

.contact-link svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  stroke: var(--color-text-muted);
  fill: none;
  stroke-width: 1.5;
  transition: stroke 0.2s ease;
}

.contact-link:hover svg {
  stroke: var(--color-primary);
}

.contact-link-text {
  display: flex;
  flex-direction: column;
}

/* WeChat Card */
.wechat-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  background: var(--color-surface);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-block: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.wechat-card img {
  width: min(200px, 80%);
  margin-inline: auto;
  border-radius: var(--radius-sm);
}

.wechat-note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.wechat-note.cn {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.wechat-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.wechat-copy:hover {
  background: var(--color-secondary);
}

.wechat-copy svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* Brand Grid */
.brand-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  margin-block: var(--space-xl);
}

.brand-logo {
  height: 3rem;
  width: auto;
  display: block;
  margin-bottom: var(--space-xs);
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.link-card:hover .brand-logo {
  opacity: 1;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--color-text-muted); }
.links-narrow { max-width: 28rem; margin-inline: 0; } /* Left aligned on desktop usually looks better for lists, but kept margin-inline 0 for now */

/* Mobile Adjustments */
@media (max-width: 600px) {
  :root {
    --space-unit: 1rem;
  }
  
  .contact-link {
    padding: var(--space-md) var(--space-sm);
  }
  
  .wechat-card {
    padding: var(--space-md);
  }
}
