/*
Theme Name: Chumphon Law
Theme URI: https://chumphonlaw.com
Description: Professional law firm theme for Chumphon International Law. Elementor-compatible — design all pages visually. Built for international clients in Thailand with schema markup and bilingual support.
Author: Chumphon International Law
Author URI: https://chumphonlaw.com
Version: 2.0.0
Requires at least: 6.3
Tested up to: 6.7
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: chumphon-law
Tags: one-column, two-columns, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, video, svg { max-width: 100%; height: auto; display: block; }

/* ==========================================================================
   CSS Custom Properties — Chumphon Law Brand
   ========================================================================== */
:root {
    --cl-navy: #1B3A5C;
    --cl-navy-dark: #122840;
    --cl-gold: #C9A84C;
    --cl-gold-light: #D4B96A;
    --cl-dark: #2D2D2D;
    --cl-body: #555555;
    --cl-light-bg: #F5F5F0;
    --cl-white: #FFFFFF;
    --cl-border: #E0E0E0;
}

/* ==========================================================================
   Typography
   ========================================================================== */
body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--cl-body);
    background-color: var(--cl-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', Georgia, serif;
    color: var(--cl-navy);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a { color: var(--cl-navy); text-decoration: none; transition: color 0.3s ease; }
a:hover, a:focus { color: var(--cl-gold); }
p { margin-bottom: 1em; }

/* ==========================================================================
   Layout Utilities
   ========================================================================== */
.cl-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.cl-section { padding: 80px 0; }
.cl-section--alt { background-color: var(--cl-light-bg); }
.cl-section--navy { background-color: var(--cl-navy); color: var(--cl-white); }

@media (max-width: 600px) {
    .cl-section { padding: 50px 0; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.cl-site-header {
    background-color: var(--cl-white);
    border-bottom: 1px solid var(--cl-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 999;
}

.cl-site-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.cl-site-header__logo img { max-height: 60px; width: auto; }
.cl-site-header__logo a { display: inline-block; }
.cl-site-header__nav { flex: 1; display: flex; justify-content: center; }

/* Desktop Nav */
.cl-nav-menu { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; }
.cl-nav-menu > li { position: relative; }
.cl-nav-menu > li > a {
    display: block; padding: 8px 16px;
    font-family: 'Noto Sans', sans-serif; font-size: 14px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--cl-navy);
    transition: color 0.3s ease;
}
.cl-nav-menu > li > a:hover,
.cl-nav-menu > li.current-menu-item > a,
.cl-nav-menu > li.current_page_item > a { color: var(--cl-gold); }

/* Dropdown */
.cl-nav-menu .sub-menu {
    list-style: none; padding: 8px 0; margin: 0;
    position: absolute; top: 100%; left: 0; min-width: 220px;
    background: var(--cl-white); border: 1px solid var(--cl-border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1); border-radius: 4px;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: all 0.3s ease; z-index: 1000;
}
.cl-nav-menu > li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.cl-nav-menu .sub-menu li a { display: block; padding: 8px 20px; font-size: 13px; color: var(--cl-dark); }
.cl-nav-menu .sub-menu li a:hover { color: var(--cl-gold); background-color: var(--cl-light-bg); }

/* Header CTA */
.cl-header-cta {
    display: inline-block; padding: 10px 24px;
    background-color: var(--cl-gold); color: var(--cl-white) !important;
    font-family: 'Noto Sans', sans-serif; font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; border-radius: 3px;
    transition: all 0.3s ease; white-space: nowrap;
}
.cl-header-cta:hover { background-color: var(--cl-navy); color: var(--cl-white) !important; }

/* Sticky */
.cl-site-header--sticky {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9990;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1); animation: cl-slideDown 0.3s ease;
}
.admin-bar .cl-site-header--sticky { top: 32px; }
@media (max-width: 782px) { .admin-bar .cl-site-header--sticky { top: 46px; } }
@keyframes cl-slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */
.cl-hide-mobile { display: inline-block; }
.cl-show-mobile-only { display: none; }
@media (max-width: 1024px) {
    .cl-hide-mobile { display: none !important; }
    .cl-show-mobile-only { display: block; }
    .cl-site-header__nav { display: none; }
}

.cl-mobile-toggle { background: none; border: none; cursor: pointer; padding: 8px; display: flex; flex-direction: column; gap: 5px; z-index: 1001; }
.cl-mobile-toggle__line { display: block; width: 26px; height: 2px; background-color: var(--cl-navy); transition: all 0.3s ease; }
.cl-mobile-toggle.is-active .cl-mobile-toggle__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cl-mobile-toggle.is-active .cl-mobile-toggle__line:nth-child(2) { opacity: 0; }
.cl-mobile-toggle.is-active .cl-mobile-toggle__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cl-mobile-nav { display: none; background: var(--cl-white); border-top: 1px solid var(--cl-border); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.cl-mobile-nav.is-open { display: block; }
.cl-mobile-nav__menu { list-style: none; padding: 0; margin: 0; }
.cl-mobile-nav__menu li { border-bottom: 1px solid var(--cl-border); }
.cl-mobile-nav__menu li a { display: block; padding: 14px 20px; font-size: 0.95rem; font-weight: 500; color: var(--cl-navy); }
.cl-mobile-nav__menu li a:hover, .cl-mobile-nav__menu li.current-menu-item a { color: var(--cl-gold); background-color: var(--cl-light-bg); }
.cl-mobile-nav__menu .sub-menu { list-style: none; padding: 0; margin: 0; background-color: var(--cl-light-bg); }
.cl-mobile-nav__menu .sub-menu li a { padding-left: 40px; font-size: 0.9rem; }

/* ==========================================================================
   Elementor Overrides — ensure full-width canvas works
   ========================================================================== */
.elementor-page .cl-content-full { padding: 0; margin: 0; max-width: 100%; }
.elementor-page .cl-page-title { display: none; } /* Elementor handles its own titles */

/* Elementor button brand colors */
.elementor-widget-button .elementor-button { font-family: 'Noto Sans', sans-serif; }
.elementor-button.elementor-size-md { padding: 14px 32px; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ==========================================================================
   Page Title (for non-Elementor pages)
   ========================================================================== */
.cl-page-title { background-color: var(--cl-navy); padding: 60px 0; text-align: center; }
.cl-page-title h1 { color: var(--cl-white); font-size: 2.2rem; margin-bottom: 10px; }
.cl-breadcrumbs { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.cl-breadcrumbs a { color: var(--cl-gold-light); }

/* ==========================================================================
   Content Area (non-Elementor fallback)
   ========================================================================== */
.cl-content-area { max-width: 800px; margin: 0 auto; padding: 60px 20px; }
.cl-content-area--wide { max-width: 1200px; }
.cl-content-area h2, .cl-content-area h3 { margin-top: 1.5em; margin-bottom: 0.5em; }
.cl-content-area p { margin-bottom: 1.2em; }
.cl-content-area ul, .cl-content-area ol { margin-bottom: 1.2em; padding-left: 1.5em; }
.cl-content-area img { border-radius: 4px; }

/* Blog layout with sidebar */
.cl-blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.cl-blog-layout__sidebar { position: sticky; top: 100px; }
.cl-blog-layout__sidebar .widget { padding: 24px; background: var(--cl-light-bg); border-radius: 4px; margin-bottom: 24px; }
.cl-blog-layout__sidebar .widget-title { font-size: 1rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--cl-gold); }
@media (max-width: 992px) { .cl-blog-layout { grid-template-columns: 1fr; } .cl-blog-layout__sidebar { position: static; } }

/* Blog cards */
.cl-post-card { background: var(--cl-white); border: 1px solid var(--cl-border); border-radius: 4px; overflow: hidden; transition: box-shadow 0.3s ease; }
.cl-post-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.cl-post-card__image { aspect-ratio: 16/10; overflow: hidden; }
.cl-post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.cl-post-card:hover .cl-post-card__image img { transform: scale(1.05); }
.cl-post-card__body { padding: 24px; }
.cl-post-card__category { display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--cl-gold); margin-bottom: 10px; }
.cl-post-card__title { font-size: 1.15rem; margin-bottom: 10px; line-height: 1.4; }
.cl-post-card__title a { color: var(--cl-navy); }
.cl-post-card__title a:hover { color: var(--cl-gold); }
.cl-post-card__excerpt { font-size: 0.9rem; color: var(--cl-body); line-height: 1.6; }
.cl-grid { display: grid; gap: 30px; }
.cl-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 600px) { .cl-grid--2 { grid-template-columns: 1fr; } }

/* Pagination */
.cl-pagination .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.cl-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--cl-border); border-radius: 3px; font-size: 0.9rem; color: var(--cl-navy); transition: all 0.3s ease; }
.cl-pagination .page-numbers:hover, .cl-pagination .page-numbers.current { background-color: var(--cl-navy); border-color: var(--cl-navy); color: var(--cl-white); }

/* ==========================================================================
   Footer
   ========================================================================== */
.cl-site-footer { background-color: var(--cl-navy-dark); color: rgba(255,255,255,0.75); }
.cl-footer-top { padding: 60px 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.cl-footer-top h4 { color: var(--cl-white); font-size: 1.1rem; margin-bottom: 20px; }
.cl-footer-top a { color: rgba(255,255,255,0.75); }
.cl-footer-top a:hover { color: var(--cl-gold); }
.cl-footer-top ul { list-style: none; padding: 0; margin: 0; }
.cl-footer-top ul li { margin-bottom: 8px; font-size: 0.9rem; }
.cl-footer-bottom { padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; text-align: center; }
.cl-footer-disclaimer { font-size: 0.75rem; opacity: 0.7; margin-top: 6px; }
@media (max-width: 768px) { .cl-footer-top { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cl-footer-top { grid-template-columns: 1fr; } }

/* WhatsApp Float */
.cl-whatsapp-float { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background-color: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,0,0,0.2); z-index: 9999; transition: transform 0.3s ease; }
.cl-whatsapp-float:hover { transform: scale(1.1); }
.cl-whatsapp-float svg { width: 32px; height: 32px; fill: var(--cl-white); }

/* 404 */
.cl-404 { text-align: center; padding: 100px 20px; }
.cl-404__code { font-family: 'Lora', serif; font-size: 8rem; font-weight: 700; color: var(--cl-gold); line-height: 1; margin-bottom: 20px; }
.cl-404__title { font-size: 1.8rem; margin-bottom: 16px; }
.cl-404__text { color: var(--cl-body); margin-bottom: 30px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cl-btn { display: inline-block; padding: 14px 32px; font-family: 'Noto Sans', sans-serif; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 3px; border: 2px solid transparent; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.cl-btn--primary { background-color: var(--cl-gold); color: var(--cl-white); border-color: var(--cl-gold); }
.cl-btn--primary:hover { background-color: transparent; color: var(--cl-gold); }
.cl-btn--navy { background-color: var(--cl-navy); color: var(--cl-white); border-color: var(--cl-navy); }
.cl-btn--navy:hover { background-color: var(--cl-gold); border-color: var(--cl-gold); }

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

/* Gutenberg */
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }

/* Print */
@media print { .cl-site-header, .cl-mobile-nav, .cl-whatsapp-float, .cl-site-footer { display: none !important; } body { font-size: 12pt; color: #000; } }
