/*
Theme Name: Authemic SEO
Theme URI: https://authemic.com
Author: Mas Hedi
Author URI: https://authemic.com
Description: Tema WordPress dioptimalkan untuk SEO modern dan kinerja maksimal. Struktur semantik, Schema markup, Core Web Vitals ready, desain minimalis.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.4
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: authemic-seo
Tags: blog, custom-logo, custom-menu, featured-images, full-width-template, one-column, two-columns, right-sidebar, theme-options, translation-ready, block-styles, wide-blocks, accessibility-ready, custom-colors, responsive-layout

Copyright (c) Mas Hedi. Authemic SEO by Mas Hedi. https://authemic.com
*/

/* ==========================================================================
   CRITICAL / BASE STYLES - Minimal untuk Core Web Vitals & CLS prevention
   Ukuran elemen utama didefinisikan agar layout tidak bergeser (no CLS)
   ========================================================================== */

:root {
  /* Typography - readable, neutral */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-lg: 1.125rem;
  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Colors - neutral, elegant */
  --color-text: #1a1a1a;
  --color-text-muted: #4b5563;
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-border: #e5e7eb;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;

  /* Spacing & layout - consistent untuk CLS */
  --header-h: 64px;
  --content-max: 720px;
  --sidebar-w: 280px;
  --gap: 1.5rem;
  --radius: 0.375rem;
}

/* Reset minimal - box-sizing untuk layout stabil */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
}

/* Ukuran reserved untuk header - hindari CLS saat sticky */
body.has-sticky-header {
  padding-top: var(--header-h);
}

/* ==========================================================================
   LAYOUT - Semantic container, max-width untuk readability
   ========================================================================== */

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
}

/* Container - lebar konsisten */
.wrap,
.site-content .wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* ==========================================================================
   HEADER - Tinggi tetap (var(--header-h)) untuk no CLS
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

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

.site-branding {
  flex-shrink: 0;
}

.site-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: var(--leading-tight);
}

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

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

/* Logo - dimensi eksplisit untuk CLS */
.site-header .custom-logo-link {
  display: block;
  line-height: 0;
}

.site-header .custom-logo-link img {
  max-height: 40px;
  width: auto;
  height: auto;
  display: block;
}

/* ==========================================================================
   NAVIGATION - Minimal, accessible
   ========================================================================== */

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.main-navigation li {
  margin: 0;
}

.main-navigation a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius);
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--color-accent);
}

.menu-toggle {
  display: none;
}

/* ==========================================================================
   TYPOGRAPHY - Content readability
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: var(--leading-tight);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }

p {
  margin-top: 0;
  margin-bottom: 1em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

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

/* ==========================================================================
   CONTENT / ENTRY - Article semantics
   ========================================================================== */

.entry-header {
  margin-bottom: var(--gap);
}

.entry-title {
  margin-bottom: 0.25em;
}

.entry-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.entry-content {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* Gambar - aspect ratio / dimensions untuk CLS, lazy load friendly */
.entry-content img,
.post-thumbnail img {
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

/* Posts list - index/archive */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.posts-list .entry-header { margin-bottom: 0.5rem; }
.posts-list .entry-summary { margin-bottom: 0.75rem; }
.posts-list .post-thumbnail { margin-bottom: 0.75rem; }
.posts-list .post-thumbnail a { display: block; line-height: 0; }
.posts-list .post-thumbnail img { width: 100%; height: auto; }
.read-more { font-weight: 600; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 1rem; font-size: var(--text-sm); color: var(--color-text-muted); }
.breadcrumb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.breadcrumb-item:not(:last-child)::after { content: "›"; margin-left: 0.25rem; }
.breadcrumb-item a { color: var(--color-accent); }
.breadcrumb-item [aria-current="page"] { color: var(--color-text-muted); }

/* Pagination */
.pagination { margin-top: 2rem; display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.pagination .nav-links { display: flex; gap: 0.5rem; }
.pagination a, .pagination span { padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); }
.pagination .current { background: var(--color-bg-alt); font-weight: 600; }
.pagination a:hover { background: var(--color-bg-alt); }

/* ==========================================================================
   SIDEBAR & WIDGETS - SEO widget area
   ========================================================================== */

.widget-area {
  font-size: var(--text-sm);
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

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

.widget li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  margin-top: auto;
  padding: var(--gap) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.site-info {
  text-align: center;
}

/* ==========================================================================
   UTILITIES - Screen reader, skip link
   ========================================================================== */

.sr-only,
.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--color-text);
  color: var(--color-bg);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   RESPONSIVE - Breakpoints
   ========================================================================== */

@media (max-width: 767px) {
  .menu-toggle {
    display: block;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
  }

  .main-navigation ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    padding: var(--gap);
    border-bottom: 1px solid var(--color-border);
  }

  .main-navigation.toggled ul {
    display: flex;
    flex-direction: column;
  }
}

@media (min-width: 768px) {
  .wrap { padding-left: 2rem; padding-right: 2rem; }
}

@media (min-width: 1024px) {
  .content-sidebar-wrap {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
  }

  .content-area {
    flex: 1;
    min-width: 0;
  }

  .widget-area {
    width: var(--sidebar-w);
    flex-shrink: 0;
  }
}
