/*
Theme Name: Goldprice WP Theme
Theme URI: https://xn--42cg1cja9c5a9bybeb7b0s.com/
Author: Goldprice
Description: WordPress theme for the Supabase-backed gold price site.
Version: 0.1.12
Requires PHP: 8.0
Text Domain: goldprice-wp-theme
*/

:root {
    --primary-gold: #c59b4e;
    --secondary-bg: #fdfbf7;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #888888;
    --success-green: #e6f6eb;
    --success-text: #28a745;
    --danger-red: #fdeaea;
    --danger-text: #dc3545;
}

@font-face {
    font-display: swap;
    font-family: Kanit;
    font-style: normal;
    font-weight: 400;
    src: url("assets/fonts/kanit/Kanit-Regular.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: Kanit;
    font-style: normal;
    font-weight: 700 800;
    src: url("assets/fonts/kanit/Kanit-Bold.ttf") format("truetype");
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--secondary-bg);
    color: var(--text-primary);
    font-family: Kanit, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.75;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: #b8860b;
}

img {
    max-width: 100%;
}

.site-shell,
.page-main {
    margin: 0 auto;
    max-width: 1200px;
    padding-left: 20px;
    padding-right: 20px;
}

.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header-inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    min-height: 72px;
    padding-bottom: 15px;
    padding-top: 15px;
}

.site-brand {
    align-items: center;
    color: #b8860b;
    display: flex;
    gap: 10px;
    text-decoration: none;
}

.site-brand span {
    color: #b8860b;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}

.site-brand-icon {
    flex: 0 0 auto;
}

.site-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.site-nav a {
    color: #6c5d3d;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover {
    color: #b8860b;
}

.site-nav > a[href$="/gold-weight-price"],
.site-nav > a[href$="/gold-weight-price/"],
.site-nav > a[href$="/gold-calculator"],
.site-nav > a[href$="/gold-calculator/"] {
    display: none;
}

.site-tools-menu {
    margin-bottom: -8px;
    padding-bottom: 8px;
    position: relative;
}

.site-tools-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #eadfca;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
}

.site-tools-toggle span {
    color: #8a6500;
    font-size: 11px;
}

.site-tools-menu:hover .site-tools-toggle,
.site-tools-menu:focus-within .site-tools-toggle {
    background: #fff8e6;
}

.site-tools-dropdown {
    background: #fff;
    border: 1px solid #eadfca;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    display: none;
    min-width: 240px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1001;
}

.site-tools-menu:hover .site-tools-dropdown,
.site-tools-menu:focus-within .site-tools-dropdown {
    display: block;
}

.site-tools-dropdown a {
    border-radius: 8px;
    color: #333;
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    padding: 10px 12px;
    text-decoration: none;
    white-space: nowrap;
}

.site-tools-dropdown a:hover,
.site-tools-dropdown a:focus {
    background: #fff8e6;
    color: #333;
}

.page-main {
    padding-bottom: 0;
    padding-top: 24px;
}

.home-intro {
    margin-bottom: 40px;
}

.home-intro h1 {
    color: #1a1a2e;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.home-intro p {
    color: #666;
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
    max-width: 920px;
}

.info-panel,
.calculator-panel,
.articles-panel,
.content-card {
    background: #fff;
    border: 1px solid #f0e6d0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-top: 28px;
    padding: 20px;
}

.info-panel h2,
.calculator-panel h2,
.articles-panel h2 {
    color: #1a1a2e;
    font-size: 20px;
    line-height: 1.4;
    margin: 0 0 14px;
}

.info-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.info-grid article {
    background: #fdfbf7;
    border: 1px solid #f4ead7;
    border-radius: 8px;
    padding: 12px;
}

.info-grid h3 {
    color: #8a6500;
    font-size: 15px;
    margin: 0 0 6px;
}

.info-grid p,
.calculator-panel p {
    color: #5f5f5f;
    font-size: 13px;
    line-height: 1.8;
    margin: 0;
}

.section-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
}

.section-heading a {
    color: #b8860b;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.post-list {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-list article {
    background: #fff;
    border: 1px solid #f0e6d0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.post-cover {
    background: #f8f1e3;
    display: block;
    aspect-ratio: 16 / 9;
}

.post-cover img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.post-body {
    padding: 16px;
}

.post-list h3,
.post-list h2 {
    font-size: 18px;
    line-height: 1.45;
    margin: 0 0 8px;
}

.post-list h3 a,
.post-list h2 a {
    color: #1a1a2e;
    text-decoration: none;
}

.post-list p {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

.post-meta {
    color: #999 !important;
    font-size: 13px !important;
    margin-bottom: 8px !important;
}

.content-card {
    margin-bottom: 40px;
}

.content-card h1 {
    color: #1a1a2e;
    line-height: 1.35;
}

.single-post-cover {
    background: #f8f1e3;
    border-radius: 12px;
    margin: 20px 0 28px;
    overflow: hidden;
}

.single-post-cover img {
    display: block;
    height: auto;
    width: 100%;
}

.static-hero {
    background: linear-gradient(135deg, #c59b4e 0%, #d4af61 40%, #e8c876 100%);
    border-radius: 24px;
    margin-bottom: 40px;
    overflow: hidden;
    padding: 48px 40px;
    position: relative;
    text-align: center;
}

.static-hero::after {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    content: "";
    height: 220px;
    position: absolute;
    right: -70px;
    top: -70px;
    width: 220px;
}

.static-hero-left {
    text-align: left;
}

.static-hero span {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 7px 14px;
    position: relative;
    z-index: 1;
}

.static-hero h1 {
    color: #3e2a0a;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    position: relative;
    z-index: 1;
}

.static-hero p {
    color: rgba(62, 42, 10, 0.68);
    font-size: 0.95rem;
    margin: 12px 0 0;
    position: relative;
    z-index: 1;
}

.static-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    margin-bottom: 40px;
    padding: clamp(24px, 4vw, 48px);
}

.static-card section {
    margin-bottom: 36px;
}

.static-card section:last-child {
    margin-bottom: 0;
}

.static-card h2 {
    border-bottom: 2px solid #f0e6d0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 16px;
    padding-bottom: 10px;
}

.static-card p,
.static-card li {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.9;
}

.static-card p {
    margin: 0 0 12px;
}

.static-card ul {
    color: #555;
    line-height: 2;
    margin: 0;
    padding-left: 22px;
}

.static-feature-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.static-feature-grid div {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px 20px;
}

.static-feature-grid strong,
.static-feature-grid span {
    display: block;
}

.static-feature-grid strong {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.static-feature-grid span {
    color: #777;
    font-size: 0.9rem;
    line-height: 1.7;
}

.static-contact-box {
    background: linear-gradient(135deg, #fdfbf7 0%, #fff9ef 100%);
    border: 1px solid rgba(197, 155, 78, 0.2);
    border-radius: 16px;
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 24px;
}

.static-contact-box a {
    color: #c59b4e;
    font-weight: 700;
    text-decoration: none;
}

.terms-block {
    align-items: flex-start;
    display: flex;
    gap: 14px;
}

.terms-block > span {
    align-items: center;
    background: linear-gradient(135deg, #c59b4e, #b8860b);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 32px;
    font-size: 0.85rem;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    margin-top: 2px;
    width: 32px;
}

.terms-block h2 {
    border-bottom: 0;
    margin-bottom: 8px;
    padding-bottom: 0;
}

.breadcrumb-lite {
    color: #999;
    display: flex;
    font-size: 14px;
    gap: 8px;
    margin-bottom: 8px;
}

.breadcrumb-lite a {
    color: #b8860b;
    text-decoration: none;
}

.articles-heading {
    border-bottom: 2px solid #f0e6d0;
    margin-bottom: 28px;
    padding-bottom: 16px;
}

.articles-heading h1 {
    color: #1a1a2e;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 6px;
}

.articles-heading p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.articles-panel-flat {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin-top: 0;
    padding: 0;
}

.content-card table {
    background: #fff;
    border: 1px solid #eadfca;
    border-collapse: separate;
    border-radius: 12px;
    border-spacing: 0;
    box-shadow: 0 8px 24px rgba(136, 102, 28, 0.06);
    font-size: 15px;
    margin: 24px 0;
    max-width: 100%;
    overflow: hidden;
    text-align: left;
    table-layout: fixed;
    width: 100%;
}

.content-card thead {
    background: #fff8e6;
}

.content-card th,
.content-card td {
    border-bottom: 1px solid #f0e6d0;
    border-right: 1px solid #f5ead6;
    padding: 14px 16px;
    vertical-align: top;
    word-break: break-word;
}

.content-card th {
    background: #fff8e6;
    color: #7a5500;
    font-weight: 800;
    line-height: 1.45;
}

.content-card td {
    color: #4f4a3f;
    line-height: 1.7;
}

.content-card tbody td:first-child {
    color: #1f2933;
    font-weight: 700;
}

.content-card tbody tr:nth-child(even) {
    background: #fffdf8;
}

.content-card tbody tr:hover {
    background: #fff8e6;
}

.content-card tbody tr:last-child th,
.content-card tbody tr:last-child td {
    border-bottom: 0;
}

.content-card tr th:last-child,
.content-card tr td:last-child {
    border-right: 0;
}

.site-footer {
    border-top: 1px solid #eee;
    color: #aaa;
    font-size: 0.95rem;
    margin-top: 60px;
    padding: 24px 20px;
    text-align: center;
}

.footer-nav {
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
    margin: 0 auto 24px;
    max-width: 980px;
    text-align: left;
}

.footer-nav-column h2 {
    color: #555;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
}

.footer-nav-column ul {
    display: grid;
    gap: 8px 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav-column:first-child ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-nav a {
    color: #b8860b;
    display: inline-block;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    color: #765700;
    text-decoration: underline;
}

.footer-source {
    color: #777;
    font-size: 13px;
    line-height: 1.75;
    margin: 0 auto 14px;
    max-width: 820px;
}

.footer-source strong {
    color: #555;
}

.footer-source a {
    color: #b8860b;
    font-weight: 700;
    text-decoration: none;
}

.footer-badge {
    margin-bottom: 12px;
    text-align: center;
}

.footer-badge img {
    display: inline-block;
    height: 40px;
    width: 160px;
}

.site-copyright {
    margin: 0;
}

.pagination-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination-wrap .page-numbers {
    background: #fff;
    border: 1px solid #f0e6d0;
    border-radius: 8px;
    color: #8a6500;
    font-size: 14px;
    font-weight: 700;
    min-width: 36px;
    padding: 6px 10px;
    text-align: center;
    text-decoration: none;
}

.pagination-wrap .current {
    background: #c59b4e;
    color: #fff;
}

@media (max-width: 900px) {
    .post-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-brand span {
        font-size: 20px;
    }

    .site-nav {
        gap: 12px;
    }

    .home-intro h1 {
        font-size: 1.3rem;
        max-width: calc(100vw - 64px);
        white-space: normal;
        word-break: break-all;
    }

    .home-intro p {
        max-width: calc(100vw - 64px);
        white-space: normal;
        word-break: break-all;
    }

    .post-list {
        grid-template-columns: 1fr;
    }

    .footer-nav {
        gap: 24px;
        grid-template-columns: 1fr;
    }

    .footer-nav-column:first-child ul {
        grid-template-columns: 1fr;
    }

    .static-hero {
        border-radius: 18px;
        padding: 34px 22px;
    }

    .static-hero-left {
        text-align: center;
    }

    .static-feature-grid {
        grid-template-columns: 1fr;
    }

    .terms-block {
        gap: 10px;
    }

    .content-card table {
        display: block;
        overflow-x: auto;
        table-layout: auto;
        white-space: normal;
    }

    .content-card th,
    .content-card td {
        min-width: 180px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
