/**
 * R2R Thailand Main Stylesheet
 */

/* ===== Layout: หน้าเต็มจอ + Footer ติดล่าง (เมื่อ content สั้นกว่า 80vh) ===== */
#page.site {
    display: flex;
    flex-direction: column;
}
#page.site.page-fill-viewport {
    min-height: 100vh !important;
}
#primary.site-main {
    flex: 1;
}

/* ===== Variables ===== */
:root {
    --color-primary: #0066cc;
    --color-secondary: #333;
    --color-pink: #e91e8c;
    --color-gray: #666;
    --color-light-gray: #f5f5f5;
    --container-width: 1200px;
}

/* ===== Container ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== Header ===== */
.site-header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Top Bar - Logo, Search, Login, Hamburger */
.header-top-bar {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.header-top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-branding .logo-r2r {
    font-family: Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: -1px;
}

.site-branding .logo-r2r .r {
    color: #0066cc;
}

.site-branding .logo-r2r .two {
    color: #e91e8c;
}

.site-branding .logo-tagline {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    padding-left: 12px;
}

.site-branding .tagline-small {
    font-size: 10px;
    color: #999;
    font-weight: 500;
}

.site-branding .tagline-main {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
}

.site-branding .tagline-main .to {
    color: #999;
    font-weight: 400;
}

/* Header Right Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search Form */
.header-search {
    position: relative;
}

.header-search input[type="search"] {
    width: 200px;
    padding: 8px 45px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}

.header-search input[type="search"]:focus {
    border-color: #e91e8c;
    box-shadow: 0 0 0 2px rgba(233, 30, 140, 0.1);
}

.header-search input[type="search"]::placeholder {
    color: #aaa;
}

.header-search .search-btn {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #e91e8c;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.header-search .search-btn:hover {
    background: #d11a7c;
}

/* Login Button */
.login-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.login-link:hover {
    color: var(--color-primary);
}

.login-link svg {
    width: 20px;
    height: 20px;
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.hamburger-menu:hover {
    border-color: #999;
}

.hamburger-menu svg {
    width: 20px;
    height: 20px;
    color: #666;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    width: 200px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.profile-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown .dropdown-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.profile-dropdown .dropdown-menu a:hover {
    background: #f5f5f5;
}

.profile-dropdown .dropdown-menu a.logout {
    color: #dc2626;
    border-top: 1px solid #eee;
}

.profile-dropdown .dropdown-menu a.logout:hover {
    background: #fef2f2;
}

/* ===== Main Navigation (Hidden for now) ===== */
.main-navigation {
    display: none;
    /* Temporarily hidden */
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.main-navigation .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.main-navigation ul li {
    position: relative;
}

.main-navigation ul li a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 15px 25px;
    text-decoration: none;
    color: var(--color-gray);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.main-navigation ul li a:hover {
    color: var(--color-primary);
}

.main-navigation ul li a svg {
    width: 12px;
    height: 12px;
}

/* Dropdown Arrow */
.menu-item-has-children>a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

/* Dropdown Menu */
.main-navigation ul li ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 100;
}

.main-navigation ul li:hover ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation ul li ul.sub-menu li a {
    padding: 12px 20px;
    font-size: 13px;
}

.main-navigation ul li ul.sub-menu li a:hover {
    background: #f8f8f8;
}

/* ===== Footer ===== */
.site-footer {
    background: #222;
    color: #fff;
    padding: 50px 0;
    margin-top: 50px;
}

.site-footer a {
    color: #fff;
}

/* ===== Utilities ===== */
.text-center {
    text-align: center;
}

.btn-login {
    background: var(--color-primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
}

/* ===== Hide Page Title ===== */
.entry-title,
.page-title,
.entry-header {
    display: none !important;
}

/* ===== หน้าแรก / เนื้อหาจาก shortcode [r2r_login] ===== */
.front-page-content,
.site-main .front-page-content {
    min-height: 50vh;
    padding: 2rem 1rem 3rem;
    background: #f8fafc;
}
.site-main:has(.front-page-content) {
    background: #f8fafc;
}

/* กล่อง "คุณเข้าสู่ระบบแล้ว" / "กรุณาเข้าสู่ระบบก่อน" (shortcode [r2r_login]) */
.r2r-already-logged-in-box,
.r2r-login-required-box {
    max-width: 28rem;
    margin: 2rem auto 3rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #e2e8f0;
}
.r2r-already-logged-in-text {
    color: #475569;
    font-size: 1rem;
    margin: 0 0 1.25rem 0;
}
.r2r-already-logged-in-btn {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}
.r2r-already-logged-in-btn:hover {
    background: #0052a3;
    color: #fff;
}

/* ฟอร์ม Login ([r2r_login] เมื่อยังไม่ล็อกอิน) */
#r2r-login-form {
    max-width: 28rem;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}
#r2r-login-form input[type="text"],
#r2r-login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}
#r2r-login-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #334155;
}
#r2r-login-form .min-h-screen {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-search input[type="search"] {
        width: 150px;
    }

    .main-navigation {
        display: none;
    }

    .site-branding .tagline-main {
        font-size: 14px;
    }

    .site-branding .logo-r2r {
        font-size: 2rem;
    }
}

.entry-content {
    min-height: 75vh;
}