/* =========================================
   RETASAN BASE STYLES
   Reset + Global Defaults
   ========================================= */

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

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

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--accent-green);
    letter-spacing: -0.02em;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color: inherit;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    text-align: justify;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--text-link-hover);
}

/* ── Lists ── */
ul, ol {
    list-style: none;
}

/* ── Images ── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Code ── */
code, pre, kbd, samp {
    font-family: var(--font-mono);
}

pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    overflow-x: auto;
    font-size: var(--fs-sm);
    line-height: 1.6;
}

code {
    background: var(--bg-tertiary);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.875em;
    color: var(--accent-cyan);
}

pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* ── Selection ── */
::selection {
    background-color: var(--accent-red);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: var(--accent-red);
    color: var(--text-primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* ── Focus Styles ── */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
}

th, td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    text-align: left;
}

th {
    background: var(--bg-tertiary);
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
}

/* ── Forms ── */
input, textarea, select, button {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

button,
input[type="submit"] {
    cursor: pointer;
    background: var(--accent-red);
    color: #fff;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--border-radius);
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
}

button:hover,
input[type="submit"]:hover {
    background: var(--accent-red-hover);
    box-shadow: var(--shadow-glow-red);
}

/* ── Blockquote ── */
blockquote {
    border-left: 3px solid var(--accent-red);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

blockquote cite {
    display: block;
    margin-top: var(--space-sm);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-style: normal;
}

/* ── Horizontal Rule ── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-xl) 0;
}

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

.screen-reader-text:focus {
    background-color: var(--bg-tertiary);
    clip: auto !important;
    clip-path: none;
    color: var(--text-primary);
    display: block;
    font-size: var(--fs-md);
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: var(--z-toast);
}

/* ── Section Wrapper ── */
.section-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ── WordPress Alignment Classes ── */
.alignleft {
    float: left;
    margin-right: var(--space-lg);
    margin-bottom: var(--space-md);
}

.alignright {
    float: right;
    margin-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-md);
}

.alignwide {
    max-width: calc(var(--max-width) + 200px);
    margin-left: auto;
    margin-right: auto;
}

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

/* ── WordPress Caption ── */
.wp-caption {
    max-width: 100%;
    margin-bottom: var(--space-md);
}

.wp-caption-text {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-sm) 0;
    font-style: italic;
}

/* ── WordPress Gallery ── */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.gallery-item {
    margin: 0;
}

.gallery-caption {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
