/*
Theme Name: Suay Maak
Theme URI: https://suaymaak.com/
Author: Enola Revenu
Author URI: https://enolarevenu.com
Description: Beauty, health and wellness affiliate product reviews for women in Thailand.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: Private
Text Domain: suaymaak
*/

/* ═══════════════════════════════════════════════════════════════
   BRAND TOKENS
═══════════════════════════════════════════════════════════════ */
:root {
    --sm-primary:        #d4618a;
    --sm-primary-dark:   #b84d74;
    --sm-primary-light:  #fff0f5;
    --sm-primary-border: #e8a5be;
    --sm-text:           #2d1f2a;
    --sm-text-mid:       #5c3d52;
    --sm-text-muted:     #8a6d7a;
    --sm-border:         #f0e0e8;
    --sm-bg:             #fdf5f8;
    --sm-white:          #ffffff;
    --sm-shadow:         0 2px 12px rgba(212, 97, 138, 0.10);
    --sm-shadow-card:    0 4px 24px rgba(44, 31, 42, 0.08);

    --sm-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sm-font-heading:   'Playfair Display', Georgia, serif;

    --sm-radius:         10px;
    --sm-radius-sm:      6px;
    --sm-radius-pill:    50px;

    --sm-max-width:      1200px;
    --sm-content-width:  780px;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--sm-font);
    color: var(--sm-text);
    background: var(--sm-white);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sm-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--sm-primary-dark); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
═══════════════════════════════════════════════════════════════ */
.sm-container {
    max-width: var(--sm-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.sm-container--narrow {
    max-width: var(--sm-content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER — liquid glass
═══════════════════════════════════════════════════════════════ */
.sm-header {
    background: rgba(255, 248, 251, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    backdrop-filter: blur(18px) saturate(1.6);
    border-bottom: 1px solid rgba(212, 97, 138, 0.18);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 24px rgba(212, 97, 138, 0.08), 0 1px 0 rgba(255,255,255,0.6) inset;
}

.sm-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.sm-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
}

.sm-logo svg {
    display: block;
    width: 210px;
    height: auto;
    transition: filter 0.3s;
}

.sm-logo:hover svg {
    filter: drop-shadow(0 2px 8px rgba(212, 97, 138, 0.35));
}

/* Orchid mark — gentle breathing pulse */
@keyframes orchid-breathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%       { transform: scale(1.06) rotate(1.5deg); }
}

.sm-orchid-mark {
    transform-origin: 28px 27px;
    animation: orchid-breathe 4s ease-in-out infinite;
}

/* Pause animation when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sm-orchid-mark { animation: none; }
}

@media (max-width: 480px) {
    .sm-logo svg { width: 168px; }
}

/* Nav */
.sm-nav { display: flex; align-items: center; gap: 4px; }

.sm-nav a {
    color: var(--sm-text-mid);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--sm-radius-sm);
    transition: background 0.2s, color 0.2s;
}

.sm-nav a:hover,
.sm-nav .current-menu-item > a {
    background: var(--sm-primary-light);
    color: var(--sm-primary);
}

/* Mobile nav toggle */
.sm-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--sm-radius-sm);
}

.sm-nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--sm-text);
    border-radius: 2px;
    transition: all 0.3s;
}

.sm-nav-toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.sm-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.sm-nav-toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu */
.sm-mobile-menu {
    display: none;
    background: var(--sm-white);
    border-top: 1px solid var(--sm-border);
    padding: 16px 0;
}

.sm-mobile-menu.is-open { display: block; }

.sm-mobile-menu .sm-container a {
    display: block;
    color: var(--sm-text-mid);
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 1px solid var(--sm-border);
    font-size: 0.95rem;
}

.sm-mobile-menu .sm-container a:hover { color: var(--sm-primary); }

/* ═══════════════════════════════════════════════════════════════
   PAGE TITLE BANNER
═══════════════════════════════════════════════════════════════ */
.sm-page-banner {
    background: linear-gradient(135deg, var(--sm-primary-light) 0%, #fce8ef 100%);
    border-bottom: 1px solid var(--sm-border);
    padding: 40px 0 36px;
}

.sm-page-banner h1 {
    font-family: var(--sm-font-heading);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--sm-text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.sm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--sm-text-muted);
    flex-wrap: wrap;
}

.sm-breadcrumb a { color: var(--sm-primary); }
.sm-breadcrumb a:hover { color: var(--sm-primary-dark); }
.sm-breadcrumb__sep { color: var(--sm-border); }

/* ═══════════════════════════════════════════════════════════════
   POST CARDS (archive / index)
═══════════════════════════════════════════════════════════════ */
.sm-archive {
    padding: 56px 0 80px;
}

.sm-archive__header {
    margin-bottom: 40px;
}

.sm-archive__title {
    font-family: var(--sm-font-heading);
    font-size: 1.8rem;
    color: var(--sm-text);
}

.sm-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.sm-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    overflow: hidden;
    box-shadow: var(--sm-shadow-card);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Gradient top accent bar — reveals on hover */
.sm-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f0a0c0, #d4618a, #9e3d6a);
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 1;
}

.sm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(212, 97, 138, 0.18), 0 4px 12px rgba(44,31,42,0.06);
    border-color: var(--sm-primary-border);
}

.sm-card:hover::before { opacity: 1; }

.sm-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.sm-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.sm-card:hover .sm-card__image img { transform: scale(1.04); }

.sm-card__image--placeholder {
    background: var(--sm-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
}

.sm-card__image--placeholder span {
    font-size: 2.5rem;
    opacity: 0.4;
}

.sm-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.sm-card__category {
    display: inline-block;
    background: var(--sm-primary-light);
    color: var(--sm-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: var(--sm-radius-pill);
    margin-bottom: 10px;
    text-decoration: none;
}

.sm-card__category:hover {
    background: var(--sm-primary);
    color: var(--sm-white);
}

.sm-card__title {
    font-family: var(--sm-font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sm-text);
    margin-bottom: 10px;
    line-height: 1.4;
    flex: 1;
}

.sm-card__title a { color: inherit; }
.sm-card__title a:hover { color: var(--sm-primary); }

.sm-card__excerpt {
    font-size: 0.875rem;
    color: var(--sm-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sm-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--sm-text-muted);
    padding-top: 14px;
    border-top: 1px solid var(--sm-border);
    margin-top: auto;
}

.sm-card__meta-item { display: flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════════════════════════════
   SINGLE POST (review layout)
═══════════════════════════════════════════════════════════════ */
.sm-post-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding: 56px 0 80px;
    align-items: start;
}

/* Hero image */
.sm-post-hero {
    border-radius: var(--sm-radius);
    overflow: hidden;
    margin-bottom: 32px;
    aspect-ratio: 16 / 7;
}

.sm-post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Post meta row */
.sm-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sm-post-meta__cat {
    display: inline-block;
    background: var(--sm-primary);
    color: var(--sm-white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: var(--sm-radius-pill);
}

.sm-post-meta__cat:hover { background: var(--sm-primary-dark); color: var(--sm-white); }

.sm-post-meta__date,
.sm-post-meta__author {
    font-size: 0.85rem;
    color: var(--sm-text-muted);
}

.sm-post-meta__sep { color: var(--sm-border); }

/* Post title */
.sm-post-title {
    font-family: var(--sm-font-heading);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--sm-text);
    line-height: 1.25;
    margin-bottom: 28px;
}

/* Post content */
.sm-post-content { color: var(--sm-text-mid); font-size: 1rem; line-height: 1.8; }

.sm-post-content h2 {
    font-family: var(--sm-font-heading);
    font-size: 1.5rem;
    color: var(--sm-text);
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sm-border);
}

.sm-post-content h3 {
    font-family: var(--sm-font-heading);
    font-size: 1.2rem;
    color: var(--sm-text);
    margin: 28px 0 10px;
}

.sm-post-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sm-text);
    margin: 20px 0 8px;
}

.sm-post-content p { margin-bottom: 20px; }

.sm-post-content ul,
.sm-post-content ol {
    padding-left: 24px;
    margin-bottom: 20px;
    list-style: revert;
}

.sm-post-content li { margin-bottom: 6px; }

.sm-post-content strong { color: var(--sm-text); font-weight: 700; }

.sm-post-content a {
    color: var(--sm-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sm-post-content a:hover { color: var(--sm-primary-dark); }

.sm-post-content img {
    border-radius: var(--sm-radius);
    margin: 24px 0;
}

.sm-post-content blockquote {
    border-left: 3px solid var(--sm-primary);
    margin: 28px 0;
    padding: 16px 24px;
    background: var(--sm-primary-light);
    border-radius: 0 var(--sm-radius) var(--sm-radius) 0;
    font-style: italic;
    color: var(--sm-text-mid);
}

/* Affiliate CTA box */
.sm-affiliate-cta {
    background: linear-gradient(135deg, var(--sm-primary-light) 0%, #fce8ef 100%);
    border: 1px solid var(--sm-primary-border);
    border-radius: var(--sm-radius);
    padding: 28px;
    margin: 32px 0;
    text-align: center;
}

.sm-affiliate-cta__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sm-text-muted);
    margin-bottom: 8px;
}

.sm-affiliate-cta__title {
    font-family: var(--sm-font-heading);
    font-size: 1.25rem;
    color: var(--sm-text);
    margin-bottom: 18px;
    font-weight: 700;
}

.sm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--sm-primary);
    color: var(--sm-white);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 13px 28px;
    border-radius: var(--sm-radius-pill);
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.sm-btn:hover {
    background: var(--sm-primary-dark);
    color: var(--sm-white);
    transform: translateY(-1px);
}

.sm-btn--outline {
    background: transparent;
    color: var(--sm-primary);
    border: 2px solid var(--sm-primary);
}

.sm-btn--outline:hover {
    background: var(--sm-primary);
    color: var(--sm-white);
}

/* Disclosure notice */
.sm-disclosure {
    background: var(--sm-bg);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius-sm);
    padding: 14px 18px;
    font-size: 0.8rem;
    color: var(--sm-text-muted);
    line-height: 1.6;
    margin: 24px 0;
}

.sm-disclosure strong { color: var(--sm-text-mid); }

/* Tags */
.sm-post-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid var(--sm-border);
}

.sm-post-tags__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sm-text-muted);
}

.sm-tag {
    background: var(--sm-bg);
    color: var(--sm-text-mid);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: var(--sm-radius-pill);
    border: 1px solid var(--sm-border);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sm-tag:hover {
    background: var(--sm-primary-light);
    color: var(--sm-primary);
    border-color: var(--sm-primary-border);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sm-sidebar { position: sticky; top: 80px; }

.sm-widget {
    background: var(--sm-white);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.sm-widget__title {
    font-family: var(--sm-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--sm-text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sm-primary);
    display: inline-block;
}

/* Sidebar buy CTA */
.sm-widget--cta {
    background: linear-gradient(160deg, var(--sm-primary) 0%, var(--sm-primary-dark) 100%);
    border-color: transparent;
    text-align: center;
}

.sm-widget--cta .sm-widget__title { color: var(--sm-white); border-color: rgba(255,255,255,0.4); }

.sm-widget--cta p {
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.sm-widget--cta .sm-btn {
    background: var(--sm-white);
    color: var(--sm-primary);
    width: 100%;
    justify-content: center;
}

.sm-widget--cta .sm-btn:hover {
    background: rgba(255,255,255,0.9);
    color: var(--sm-primary-dark);
    transform: none;
}

/* Recent posts in sidebar */
.sm-sidebar-posts { display: flex; flex-direction: column; gap: 16px; }

.sm-sidebar-post { display: flex; gap: 12px; }

.sm-sidebar-post__img {
    width: 68px;
    height: 68px;
    border-radius: var(--sm-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.sm-sidebar-post__img img { width: 100%; height: 100%; object-fit: cover; }

.sm-sidebar-post__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sm-text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.sm-sidebar-post__title a { color: inherit; }
.sm-sidebar-post__title a:hover { color: var(--sm-primary); }

.sm-sidebar-post__date { font-size: 0.75rem; color: var(--sm-text-muted); }

/* Category list in sidebar */
.sm-sidebar-cats { display: flex; flex-direction: column; gap: 4px; }

.sm-sidebar-cats a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--sm-radius-sm);
    color: var(--sm-text-mid);
    font-size: 0.875rem;
    transition: background 0.2s, color 0.2s;
}

.sm-sidebar-cats a:hover {
    background: var(--sm-primary-light);
    color: var(--sm-primary);
}

.sm-sidebar-cats .count {
    background: var(--sm-bg);
    color: var(--sm-text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--sm-radius-pill);
}

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════════ */
.sm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 56px;
    flex-wrap: wrap;
}

.sm-pagination a,
.sm-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--sm-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--sm-border);
    color: var(--sm-text-mid);
    transition: all 0.2s;
}

.sm-pagination a:hover {
    background: var(--sm-primary-light);
    color: var(--sm-primary);
    border-color: var(--sm-primary-border);
}

.sm-pagination .current {
    background: var(--sm-primary);
    color: var(--sm-white);
    border-color: var(--sm-primary);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.sm-footer {
    background: var(--sm-text);
    color: rgba(255,255,255,0.7);
    padding: 56px 0 0;
}

.sm-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sm-footer__logo {
    font-family: var(--sm-font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sm-white);
    margin-bottom: 12px;
    display: block;
}

.sm-footer__logo:hover { color: var(--sm-primary); }

.sm-footer__desc {
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 280px;
}

.sm-footer__heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sm-white);
    margin-bottom: 16px;
}

.sm-footer__links { display: flex; flex-direction: column; gap: 8px; }

.sm-footer__links a {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
}

.sm-footer__links a:hover { color: var(--sm-primary); }

.sm-footer__bottom {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap;
    gap: 8px;
}

.sm-footer__bottom a { color: rgba(255,255,255,0.5); }
.sm-footer__bottom a:hover { color: var(--sm-primary); }

/* ═══════════════════════════════════════════════════════════════
   NO RESULTS / 404
═══════════════════════════════════════════════════════════════ */
.sm-empty {
    text-align: center;
    padding: 80px 24px;
}

.sm-empty__icon { font-size: 3rem; margin-bottom: 16px; }

.sm-empty h2 {
    font-family: var(--sm-font-heading);
    font-size: 1.5rem;
    color: var(--sm-text);
    margin-bottom: 10px;
}

.sm-empty p { color: var(--sm-text-muted); margin-bottom: 24px; }

/* ═══════════════════════════════════════════════════════════════
   WORDPRESS ALIGNMENT CLASSES
═══════════════════════════════════════════════════════════════ */
.alignleft  { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin: 24px auto; }
.alignwide { margin-left: -40px; margin-right: -40px; max-width: none; }
.alignfull { margin-left: calc(50% - 50vw + 12px); margin-right: calc(50% - 50vw + 12px); max-width: none; }

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sm-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .sm-post-wrap { grid-template-columns: 1fr; }
    .sm-sidebar { position: static; }
    .sm-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sm-nav { display: none; }
    .sm-nav-toggle { display: flex; }
    .sm-posts-grid { grid-template-columns: 1fr; }
    .sm-footer__grid { grid-template-columns: 1fr; gap: 32px; }
    .sm-footer__desc { max-width: 100%; }
    .sm-post-hero { aspect-ratio: 16 / 9; }
    .sm-page-banner { padding: 28px 0 24px; }
}

@media (max-width: 480px) {
    .sm-container, .sm-container--narrow { padding: 0 16px; }
    .sm-affiliate-cta { padding: 20px 16px; }
    .sm-btn { padding: 12px 20px; font-size: 0.9rem; }
}
