/* ===== CSS Variables ===== */
:root {
    --pink-50: #fdf2f8;
    --pink-100: #fce7f3;
    --pink-200: #fbcfe8;
    --pink-300: #f9a8d4;
    --pink-400: #f472b6;
    --pink-500: #ec4899;
    --pink-600: #db2777;
    --pink-700: #be185d;
    --pink-800: #9d174d;
    --pink-900: #831843;
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-700);
    background: var(--pink-50);
    line-height: 1.7;
    font-size: 16px;
}
a { color: var(--pink-600); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--pink-800); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ===== Utility ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Header ===== */
.site-header {
    background: linear-gradient(135deg, var(--pink-600), var(--pink-500), var(--pink-400));
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

/* Top row: Logo + Search */
.header-top {
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
}
.site-logo img { height: 40px; width: auto; border-radius: 50%; }
.site-logo svg { width: 38px; height: 38px; }
.site-logo:hover { color: var(--white); opacity: 0.9; }

/* Bottom row: Navigation */
.header-bottom {
    background: rgba(0,0,0,0.08);
}
.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}
.desktop-nav a {
    color: rgba(255,255,255,0.9);
    padding: 10px 16px;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}
.desktop-nav a:hover, .desktop-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-bottom-color: var(--white);
}

/* Search */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
}
.header-search input {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 8px 36px 8px 14px;
    border-radius: 50px;
    font-size: 0.875rem;
    width: 200px;
    outline: none;
    transition: var(--transition);
}
.header-search input::placeholder { color: rgba(255,255,255,0.7); }
.header-search input:focus {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    width: 240px;
}
.header-search button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 4px;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.mobile-toggle:hover { background: rgba(255,255,255,0.2); }
.hamburger { width: 24px; height: 18px; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}
.mobile-toggle.active .hamburger span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active .hamburger span:nth-child(2) { opacity: 0; }
.mobile-toggle.active .hamburger span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}
.mobile-nav.open { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav-inner { padding: 20px; }
.mobile-nav a {
    display: block;
    padding: 14px 16px;
    color: var(--gray-700);
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid var(--gray-100);
    border-radius: var(--radius-sm);
}
.mobile-nav a:hover, .mobile-nav a.active {
    background: var(--pink-50);
    color: var(--pink-600);
}
.mobile-nav .mobile-search {
    padding: 16px 0;
}
.mobile-nav .mobile-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--pink-200);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
}
.mobile-nav .mobile-search input:focus { border-color: var(--pink-400); }

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--pink-100), var(--rose-100), var(--pink-50));
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--pink-200) 0%, transparent 70%);
    opacity: 0.5;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--rose-100) 0%, transparent 70%);
    opacity: 0.5;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-size: 2.5rem;
    color: var(--pink-800);
    margin-bottom: 16px;
    font-weight: 800;
}
.hero p {
    font-size: 1.15rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 30px;
}
.hero-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: inline-block;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--pink-600), var(--pink-700));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}
.btn-outline {
    background: transparent;
    color: var(--pink-600);
    border: 2px solid var(--pink-300);
}
.btn-outline:hover {
    background: var(--pink-50);
    color: var(--pink-700);
    border-color: var(--pink-500);
}

/* ===== Section Titles ===== */
.section { padding: 50px 0; }
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 1.8rem;
    color: var(--pink-800);
    font-weight: 700;
    margin-bottom: 8px;
}
.section-title p { color: var(--gray-500); font-size: 1rem; }
.section-title .underline {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--pink-400), var(--pink-600));
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ===== Category Cards ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--pink-100);
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pink-400), var(--pink-600));
    opacity: 0;
    transition: var(--transition);
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--pink-200);
}
.category-card:hover::before { opacity: 1; }
.category-card .icon {
    width: 60px;
    height: 60px;
    background: var(--pink-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}
.category-card h3 {
    font-size: 1.05rem;
    color: var(--gray-800);
    margin-bottom: 8px;
    font-weight: 600;
}
.category-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
}
.category-card .count {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 12px;
    background: var(--pink-50);
    color: var(--pink-600);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== Article Cards ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--pink-100);
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.article-card .card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--pink-200), var(--pink-300));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
}
.article-card .card-image img { width: 100%; height: 100%; object-fit: cover; }
.article-card .card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.article-card .card-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--pink-100);
    color: var(--pink-600);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    align-self: flex-start;
}
.article-card h3 {
    font-size: 1.05rem;
    color: var(--gray-800);
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card h3 a { color: inherit; }
.article-card h3 a:hover { color: var(--pink-600); }
.article-card .card-excerpt {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.8rem;
    color: var(--gray-400);
}
.article-card .read-more {
    color: var(--pink-500);
    font-weight: 600;
    font-size: 0.85rem;
}
.article-card .read-more:hover { color: var(--pink-700); }

/* ===== Article Page ===== */
.article-header { margin-bottom: 30px; }
.article-header .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--gray-400);
}
.article-header .breadcrumb a { color: var(--pink-500); }
.article-header .breadcrumb .sep { color: var(--gray-300); }
.article-header h1 {
    font-size: 2rem;
    color: var(--gray-800);
    line-height: 1.4;
    font-weight: 700;
    margin-bottom: 16px;
}
.article-header .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--gray-400);
}
.article-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--pink-100);
    margin-bottom: 40px;
}
.article-content h2 { font-size: 1.5rem; color: var(--pink-800); margin: 30px 0 16px; font-weight: 700; }
.article-content h3 { font-size: 1.2rem; color: var(--pink-700); margin: 24px 0 12px; font-weight: 600; }
.article-content p { margin-bottom: 16px; line-height: 1.8; }
.article-content ul, .article-content ol { margin: 16px 0; padding-left: 24px; list-style: initial; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; line-height: 1.7; }
.article-content strong { color: var(--gray-800); }
.article-content img { border-radius: var(--radius-sm); margin: 20px 0; }
.article-content blockquote {
    border-left: 4px solid var(--pink-400);
    padding: 16px 24px;
    background: var(--pink-50);
    margin: 20px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--gray-600);
}

/* Related */
.related-section { margin-top: 50px; }

/* ===== Sidebar ===== */
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; padding: 40px 0; }
.sidebar .widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--pink-100);
}
.sidebar .widget h3 {
    font-size: 1.05rem;
    color: var(--pink-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--pink-100);
    font-weight: 600;
}
.sidebar .widget ul li { margin-bottom: 4px; }
.sidebar .widget ul li a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.9rem;
    transition: var(--transition);
}
.sidebar .widget ul li a:hover {
    background: var(--pink-50);
    color: var(--pink-600);
}

/* ===== Footer ===== */
.site-footer {
    background: linear-gradient(135deg, var(--pink-800), var(--pink-900));
    color: rgba(255,255,255,0.8);
    padding: 50px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}
.footer-col p { font-size: 0.9rem; line-height: 1.7; margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* ===== Page Header ===== */
.page-header {
    background: linear-gradient(135deg, var(--pink-100), var(--rose-100));
    padding: 40px 0;
    text-align: center;
}
.page-header h1 { font-size: 1.8rem; color: var(--pink-800); font-weight: 700; margin-bottom: 8px; }
.page-header p { color: var(--gray-500); }

/* ===== Search Results ===== */
.search-bar-hero {
    max-width: 600px;
    margin: 0 auto;
}
.search-bar-hero form { display: flex; gap: 10px; }
.search-bar-hero input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--pink-200);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
}
.search-bar-hero input:focus { border-color: var(--pink-400); }
.search-bar-hero button { padding: 14px 28px; }

/* ===== 404 ===== */
.not-found { text-align: center; padding: 80px 20px; }
.not-found h1 { font-size: 6rem; color: var(--pink-300); font-weight: 800; }
.not-found h2 { font-size: 1.5rem; color: var(--gray-700); margin: 16px 0; }
.not-found p { color: var(--gray-500); margin-bottom: 30px; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}
.pagination a:hover { background: var(--pink-50); border-color: var(--pink-300); color: var(--pink-600); }
.pagination .active { background: var(--pink-500); color: var(--white); border-color: var(--pink-500); }

/* ===== Contact Form ===== */
.contact-form { max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--pink-400); }
.form-group textarea { min-height: 150px; resize: vertical; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .header-bottom { display: none; }
    .header-search { display: none; }
    .mobile-toggle { display: flex; }
    .content-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero { padding: 40px 0; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .section { padding: 30px 0; }
    .section-title h2 { font-size: 1.4rem; }
    .articles-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .article-content { padding: 24px; }
    .article-header h1 { font-size: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .header-top-inner { height: 56px; }
    .mobile-nav { top: 56px; }
    .site-logo { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .categories-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5rem; }
    .article-content { padding: 16px; }
    .article-content h2 { font-size: 1.3rem; }
}
