/* NRRU Room Booking — front-end look. Colours from nrru.ac.th: logo green #006030, heading gold #F5BB1B.
   Loaded on every front-end page (includes/booking-form.php → rb_enqueue_front). */

:root {
	--rb-green: #006030;
	--rb-green-700: #004a25;
	--rb-green-50: #e8f3ec;
	--rb-gold: #f5bb1b;
	--rb-gold-600: #c99200;
	--rb-gold-50: #fff5d6;
	--rb-red: #c0392b;
	--rb-red-50: #fdecea;
	--rb-ink: #1c2a22;
	--rb-muted: #5b6b62;
	--rb-line: #dbe5df;
	--rb-soft: #f5f8f6;
	--rb-radius: 14px;
	--rb-shadow: 0 1px 2px rgba(16, 40, 28, .06), 0 6px 18px rgba(16, 40, 28, .06);
	--rb-font-head: 'Prompt', sans-serif;
	--rb-font-body: 'Sarabun', sans-serif;
}

/* ---- whole site (theme header / footer / type) ---- */
:root body { font-family: var(--rb-font-body); color: var(--rb-ink); }
:root :is(h1, h2, h3, h4, .wp-block-site-title, .wp-block-navigation, .wp-block-loginout) { font-family: var(--rb-font-head); }
:root header.wp-block-template-part { border-bottom: 3px solid var(--rb-gold); background: #fff; }
:root .wp-block-site-title a { color: var(--rb-green); text-decoration: none; font-weight: 700; }
:root header .wp-block-navigation a { color: var(--rb-ink); text-decoration: none; font-weight: 500; }
:root header .wp-block-navigation a:hover,
:root header .wp-block-navigation .current-menu-item > a { color: var(--rb-green); text-decoration: underline; text-decoration-color: var(--rb-gold); text-decoration-thickness: 3px; text-underline-offset: 8px; }
:root header .wp-block-loginout a { color: var(--rb-green); font-weight: 600; }
:root footer.wp-block-template-part { background: var(--rb-green-700); color: #fff; margin-top: 3rem; }
:root footer.wp-block-template-part a { color: var(--rb-gold); }
:root footer.wp-block-template-part > .wp-block-group { border-top: 0 !important; background: transparent !important; color: inherit; }
:root footer.wp-block-template-part p { color: inherit; }

/* ---- plugin pages ---- */
.rb-booking { max-width: 960px; margin: 0 auto; color: var(--rb-ink); font-family: var(--rb-font-body); }
.rb-booking.rb-wide { max-width: none; }
.rb-booking p { margin: 0 0 .75rem; }
.rb-icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }

.rb-section-title { font-size: 1.35rem; margin: 2.25rem 0 1rem; display: flex; align-items: center; gap: .5rem; }
.rb-section-title::after { content: ""; flex: 0 0 48px; height: 4px; border-radius: 2px; background: var(--rb-gold); margin-left: .25rem; }
.rb-count { font-size: .85rem; font-weight: 600; background: var(--rb-green-50); color: var(--rb-green); border-radius: 999px; padding: .05rem .6rem; }
.rb-hint { color: var(--rb-muted); font-size: .95rem; }
.rb-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.rb-links a, .rb-booking a:not(.rb-btn) { color: var(--rb-green); }
.rb-empty { color: var(--rb-muted); background: var(--rb-soft); border: 1px dashed var(--rb-line); border-radius: var(--rb-radius); padding: 1rem 1.25rem; }

/* buttons */
.rb-buttons { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0 0; }
.rb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	padding: .65em 1.25em; border-radius: 10px; border: 1.5px solid var(--rb-green);
	background: #fff; color: var(--rb-green) !important; text-decoration: none !important;
	font-family: var(--rb-font-head); font-weight: 600; font-size: 1rem; line-height: 1.2; cursor: pointer;
	transition: background .15s, transform .15s, box-shadow .15s;
}
.rb-btn:hover { background: var(--rb-green-50); transform: translateY(-1px); }
.rb-btn-primary { background: var(--rb-gold); border-color: var(--rb-gold); color: var(--rb-ink) !important; box-shadow: 0 4px 12px rgba(245, 187, 27, .35); }
.rb-btn-primary:hover { background: #ffc93a; }
.rb-btn-danger { border-color: var(--rb-red); color: var(--rb-red) !important; }
.rb-btn-danger:hover { background: var(--rb-red-50); }
.rb-btn-sm { padding: .4em .85em; font-size: .9rem; }
.rb-btn-lg { padding: .85em 1.75em; font-size: 1.1rem; }

/* messages */
.rb-msg { border-radius: 12px; padding: .9rem 1.1rem; margin: 0 0 1.25rem; border: 1px solid; }
.rb-msg p:last-child { margin: 0; }
.rb-msg.success { background: var(--rb-green-50); border-color: #b9dcc6; color: var(--rb-green-700); }
.rb-msg.error { background: var(--rb-red-50); border-color: #f2c2bd; color: #8e2a20; }
.rb-msg.warning { background: var(--rb-gold-50); border-color: #f1d98a; color: #6b4e00; }

/* cards & chips */
.rb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.rb-card { display: block; background: #fff; border: 1px solid var(--rb-line); border-radius: var(--rb-radius); padding: 1.1rem 1.2rem; box-shadow: var(--rb-shadow); margin: 0 0 1rem; }
.rb-cards .rb-card { margin: 0; }
.rb-card strong { display: block; font-family: var(--rb-font-head); font-weight: 600; font-size: 1.05rem; margin: 0 0 .25rem; }
.rb-card small { display: block; color: var(--rb-muted); margin: .2rem 0 0; }
.rb-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .25rem; }
.rb-chip { display: inline-flex; align-items: center; gap: .3em; background: var(--rb-soft); border: 1px solid var(--rb-line); border-radius: 999px; padding: .1rem .6rem; font-size: .85rem; color: var(--rb-muted); }
.rb-type-card { transition: transform .15s, box-shadow .15s; }
.rb-type-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 40, 28, .1); }
.rb-type-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--rb-green-50); color: var(--rb-green); font-size: 1.3rem; margin: 0 0 .75rem; }

/* ---- home ---- */
.rb-hero {
	position: relative; overflow: hidden; color: #fff; border-radius: 22px;
	padding: clamp(1.5rem, 4vw, 3rem); margin: 0 0 1.5rem;
	background: radial-gradient(circle at 85% 15%, rgba(245, 187, 27, .28), transparent 40%), linear-gradient(135deg, var(--rb-green) 0%, var(--rb-green-700) 100%);
}
.rb-hero::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(245, 187, 27, .18); }
.rb-hero > * { position: relative; z-index: 1; }
.rb-hero h2 { color: #fff; font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: .25rem 0 .5rem; line-height: 1.2; }
.rb-eyebrow { color: var(--rb-gold); font-family: var(--rb-font-head); font-weight: 600; letter-spacing: .02em; }
.rb-lead { font-size: 1.1rem; max-width: 40em; opacity: .92; }
.rb-facts { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.rb-facts li { display: inline-flex; align-items: center; gap: .4em; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: .3rem .8rem; font-size: .95rem; }
.rb-greeting { margin: 1.25rem 0 0 !important; font-size: 1.05rem; }
.rb-hero .rb-btn:not(.rb-btn-primary) { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .7); }
.rb-hero .rb-btn:not(.rb-btn-primary):hover { background: rgba(255, 255, 255, .12); }
.rb-hero .rb-msg { margin: 1rem 0 0; }

.rb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.rb-stat { display: flex; flex-direction: column; gap: .15rem; background: #fff; border: 1px solid var(--rb-line); border-radius: var(--rb-radius); padding: 1.1rem 1.25rem; box-shadow: var(--rb-shadow); text-decoration: none !important; color: var(--rb-ink) !important; }
.rb-stat-accent { background: var(--rb-green-50); border-color: #b9dcc6; }
.rb-stat-label { color: var(--rb-muted); font-size: .9rem; }
.rb-stat-value { font-family: var(--rb-font-head); font-weight: 700; font-size: 2rem; color: var(--rb-green); line-height: 1.2; }
.rb-stat-value small { font-size: 1rem; font-weight: 500; color: var(--rb-muted); }
.rb-stat-note { font-size: .85rem; color: var(--rb-muted); }

.rb-steps { list-style: none; counter-reset: rb-step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.rb-steps li { counter-increment: rb-step; background: #fff; border: 1px solid var(--rb-line); border-radius: var(--rb-radius); padding: 1.1rem 1.2rem; }
.rb-steps li::before { content: counter(rb-step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--rb-gold); color: var(--rb-ink); font-family: var(--rb-font-head); font-weight: 700; margin: 0 0 .6rem; }
.rb-steps strong { display: block; font-family: var(--rb-font-head); font-weight: 600; }
.rb-steps span { color: var(--rb-muted); font-size: .95rem; }

/* ---- forms (booking form, room status day picker) ---- */
.rb-panel { background: #fff; border: 1px solid var(--rb-line); border-radius: 18px; padding: 1.25rem 1.4rem; margin: 0 0 1.5rem; box-shadow: var(--rb-shadow); }
.rb-panel-title { display: flex; align-items: center; gap: .6rem; font-family: var(--rb-font-head); font-weight: 600; font-size: 1.15rem; margin: .5rem 0 .4rem !important; }
.rb-step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rb-green); color: #fff; font-size: .9rem; }
.rb-row { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end; }
.rb-grow { flex: 1 1 260px; }
.rb-booking label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
.rb-booking :is(input[type=date], input[type=text], input:not([type]), select) {
	font: inherit; font-weight: 400; padding: .6em .8em; border: 1.5px solid var(--rb-line); border-radius: 10px; background: #fff; color: var(--rb-ink); min-height: 2.8em;
}
.rb-booking select { height: 2.8em; min-width: 9em; }
.rb-booking :is(input, select):focus { outline: none; border-color: var(--rb-green); box-shadow: 0 0 0 3px rgba(0, 96, 48, .15); }
.rb-booking input[type=radio] { accent-color: var(--rb-green); width: 1.15em; height: 1.15em; margin: .2rem 0 0; }

.rb-room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin: .5rem 0 1.25rem; }
.rb-room { flex-direction: row !important; align-items: flex-start; gap: .7rem !important; font-weight: 400 !important; background: #fff; border: 1.5px solid var(--rb-line); border-radius: var(--rb-radius); padding: 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.rb-room:hover { border-color: #9fcab0; }
.rb-room:has(input:checked) { border-color: var(--rb-green); background: var(--rb-green-50); box-shadow: 0 0 0 3px rgba(0, 96, 48, .1); }
.rb-room-body strong { display: block; font-family: var(--rb-font-head); font-weight: 600; font-size: 1.05rem; }
.rb-room-body small { display: block; color: var(--rb-muted); }

/* ---- my bookings ---- */
.rb-booking-card { display: flex; gap: 1rem; align-items: flex-start; border-left: 5px solid var(--rb-line); }
.rb-edge-approved, .rb-edge-checked_in { border-left-color: var(--rb-green); }
.rb-edge-pending { border-left-color: var(--rb-gold); }
.rb-edge-rejected, .rb-edge-no_show { border-left-color: var(--rb-red); }
.rb-edge-cancelled { border-left-color: #b8c2bc; opacity: .85; }
.rb-date-block { flex: none; width: 64px; text-align: center; background: var(--rb-green-50); border-radius: 12px; padding: .45rem 0; color: var(--rb-green); }
.rb-date-day { display: block; font-family: var(--rb-font-head); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.rb-date-month { display: block; font-size: .8rem; }
.rb-booking-body { flex: 1; min-width: 0; }
.rb-booking-body p { margin: .6rem 0 0; }
.rb-reason { background: var(--rb-red-50); border-radius: 10px; padding: .5rem .75rem; color: #8e2a20; font-size: .95rem; }

.rb-status { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .8rem; font-weight: 600; margin: 0 0 .35rem; background: #eef1ef; color: var(--rb-muted); }
.rb-status-approved, .rb-status-checked_in { background: var(--rb-green-50); color: var(--rb-green); }
.rb-status-pending { background: var(--rb-gold-50); color: #7a5700; }
.rb-status-rejected, .rb-status-no_show { background: var(--rb-red-50); color: var(--rb-red); }

/* ---- room status grid ---- */
.rb-daynav .rb-row { align-items: center; }
.rb-daynav label { flex-direction: row; align-items: center; gap: .5rem; }
.rb-legend { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rb-legend span { border-radius: 999px; padding: .15rem .75rem; font-size: .85rem; border: 1px solid var(--rb-line); }
.rb-legend small { flex-basis: 100%; color: var(--rb-muted); }
.rb-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1rem; border: 1px solid var(--rb-line); border-radius: var(--rb-radius); background: #fff; box-shadow: var(--rb-shadow); }
.rb-grid { border-collapse: separate; border-spacing: 0; font-size: .85rem; width: 100%; }
.rb-grid th, .rb-grid td { border-right: 1px solid #edf1ee; border-bottom: 1px solid #edf1ee; padding: 0; text-align: center; min-width: 2.4em; height: 2.6em; }
.rb-grid thead th { background: var(--rb-green-700); color: #fff; font-weight: 500; font-size: .75rem; padding: .35em .2em; white-space: nowrap; }
.rb-grid th.rb-room-name { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: .35em .7em; min-width: 9.5em; font-weight: 600; font-family: var(--rb-font-head); }
.rb-grid thead th.rb-room-name { background: var(--rb-green-700); }
.rb-grid th.rb-room-name small { display: block; color: var(--rb-muted); font-weight: 400; font-family: var(--rb-font-body); }
.rb-grid .free, .rb-legend .free { background: #e3f3e9; }
.rb-grid .pending, .rb-legend .pending { background: #ffefbf; }
.rb-grid .booked, .rb-legend .booked { background: #f6c9c4; }
.rb-grid .closed, .rb-legend .closed { background: #eceeed; color: var(--rb-muted); }
.rb-grid .past { opacity: .35; }
.rb-grid a { display: block; width: 100%; height: 100%; min-height: 2.6em; }
.rb-grid td.free:has(a):hover { background: #bfe4cd; }

@media (max-width: 600px) {
	.rb-hero { border-radius: 16px; }
	.rb-buttons .rb-btn { flex: 1 1 100%; }
	.rb-panel { padding: 1rem; }
	.rb-booking-card { gap: .75rem; }
	.rb-date-block { width: 54px; }
}
