/*
Theme Name: NCBEET
Theme URI: https://ncbeet.com
Author: NCBEET
Author URI: https://ncbeet.com
Description: Custom WordPress theme for NCBEET. 100%% WordPress core — no external plugins required. Minimalist design with sidebar navigation, gallery pages, native collaboration form with AJAX and wp_mail, and story section.
Version: 2.0.0
Requires at least: 6.0
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: ncbeet
Tags: custom-menu, featured-images, full-width-template, custom-logo
*/

/* ===================== LOCAL FONTS ===================== */
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/BarlowCondensed-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Arial';
  src: url('fonts/arial.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===================== RESET & BASE ===================== */
:root {
  --bg: #e2e0dd;
  --bg-light: #eae8e5;
  --bg-form: #f2f0ed;
  --text: #1a1a1a;
  --text-muted: #999;
  --accent: #8b2232;
  --white: #ffffff;
  --black: #1a1a1a;
  --sidebar-w: 240px;
  --sidebar-w-mobile: 60vw;
  --header-h: 70px;
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body: 'Arial', sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input { font-family: inherit; border: none; outline: none; background: none; }

/* ===================== HEADER ===================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
  background: transparent;
  pointer-events: none;
}
.site-header > * { pointer-events: all; }

.hamburger {
  width: 32px; height: 20px;
  cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; z-index: 1001;
}
.hamburger span {
  display: block; width: 100%; height: 2.5px;
  background: var(--black);
  transition: all 0.4s var(--ease);
  transform-origin: center;
  border-radius: 1px;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(8.75px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-8.75px) rotate(-45deg); }

/* Language Switcher */
.lang-switcher {
  position: relative; z-index: 1001;
  pointer-events: all;
}
.lang-switcher__current {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 400; letter-spacing: 0.5px;
  color: var(--text); cursor: pointer;
  background: none; border: none; padding: 6px 2px;
  transition: opacity 0.3s var(--ease);
}
.lang-switcher__current:hover { opacity: 0.6; }

.lang-switcher__dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--white);
  min-width: 52px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-radius: 2px;
  padding: 4px 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.lang-switcher__dropdown.is-open {
  opacity: 1; visibility: visible; pointer-events: all;
  transform: translateY(0);
}
.lang-switcher__option {
  display: block;
  padding: 8px 16px;
  font-size: 14px; letter-spacing: 0.5px;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  text-align: center;
  cursor: pointer;
}
.lang-switcher__option:hover {
  background: var(--bg);
  color: var(--accent);
}

/* ===================== SIDEBAR ===================== */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.12);
  z-index: 998;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.sidebar-overlay.is-active { opacity: 1; visibility: visible; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh; height: 100dvh;
  background: var(--white);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease);
  display: flex; flex-direction: column;
  padding: 80px 0 30px;
  overflow-y: auto;
}
.sidebar.is-active { transform: translateX(0); }

.sidebar-logo { padding: 10px 30px 20px; }
.sidebar-logo img, .sidebar-logo svg { width: 120px; height: auto; }

.sidebar-nav {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 30px;
}
.sidebar-nav a {
  font-family: var(--font-heading);
  font-size: 18px; letter-spacing: 1.5px; font-weight: 300;
  color: var(--black);
  padding: 9px 0;
  transition: color 0.3s var(--ease);
  text-transform: uppercase;
  display: block;
}
.sidebar-nav a:hover, .sidebar-nav a.current { color: var(--accent); }

.sidebar-footer {
  padding: 20px 30px;
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.5px; line-height: 1.5;
}
.sidebar-footer .heart-icon { display: inline-block; color: var(--black); font-size: 10px; }

/* ===================== MAIN ===================== */
.site-main { min-height: 100vh; }

/* ===================== HOME — Hero with Loading Splash ===================== */
.page-home {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* Background layer (image/gif/video) */
.home-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.home-bg.is-loaded { opacity: 1; }

.home-bg__video,
.home-bg__image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.home-bg__overlay {
  position: absolute; inset: 0;
  background: #000;
  pointer-events: none;
}

/* Splash / Loading state */
.home-splash {
  position: absolute; inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.home-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* When no media is set, splash stays visible permanently */
.home-splash--static {
  background: var(--bg);
}
.home-splash--static .home-splash__logo {
  animation: ncbeet-fadeUp 1s var(--ease) 0.3s forwards;
}

.home-splash__logo {
  text-align: center;
  opacity: 0;
  animation: ncbeet-fadeUp 0.8s var(--ease) 0.2s forwards;
}
.home-splash__logo img,
.home-splash__logo svg { width: 160px; height: auto; margin: 0 auto; }

/* Subtle loading spinner */
.home-splash__loader {
  margin-top: 30px;
  opacity: 0;
  animation: ncbeet-fadeIn 0.5s var(--ease) 1s forwards;
}

.home-splash__spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(26,26,26,0.15);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: ncbeet-spin 0.8s linear infinite;
}

@keyframes ncbeet-spin {
  to { transform: rotate(360deg); }
}

@keyframes ncbeet-fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ncbeet-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.scroll-hint {
  position: absolute; bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  transition: opacity 0.6s var(--ease);
  animation: ncbeet-bounce 2.2s ease-in-out infinite;
}
.scroll-hint svg { width: 20px; height: 20px; stroke: var(--white); }

/* If no media, scroll hint uses dark stroke */
.page-home:not(:has(.home-bg)) .scroll-hint svg { stroke: var(--text); }

@keyframes ncbeet-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===================== GALLERY ===================== */
.page-gallery { padding: calc(var(--header-h) + 20px) 0 60px; min-height: 100vh; }

.gallery-wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

.gallery-viewport {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-light); border-radius: 2px;
  overflow: hidden; position: relative;
}
.gallery-viewport .gallery-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.6s var(--ease);
}
.gallery-viewport .gallery-slide.is-active { opacity: 1; }
.gallery-viewport .gallery-slide img { width: 100%; height: 100%; object-fit: cover; }

.gallery-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 40px; margin-top: 24px;
}
.gallery-arrow {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: opacity 0.25s;
}
.gallery-arrow:hover { opacity: 0.5; }
.gallery-arrow svg { width: 22px; height: 22px; stroke: var(--text); fill: none; stroke-width: 1.2; }

h1.gallery-title,
.gallery-title {
  font-family: var(--font-heading);
  font-size: 16px; letter-spacing: 3px;
  text-transform: uppercase; user-select: none;
  font-weight: 300; margin: 0;
}

/* ===================== COLLAB ===================== */
.page-collab { padding: calc(var(--header-h) + 40px) 0 80px; min-height: 100vh; }

.collab-wrap {
  max-width: 1100px; margin: 0 auto; padding: 0 40px;
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 60px; align-items: start;
}
.collab-intro { padding-top: 20px; }
.collab-intro h1 {
  font-family: var(--font-heading);
  font-size: 22px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 30px; font-weight: 400;
}
.collab-intro p {
  font-size: 14px; line-height: 1.85;
  color: var(--text); margin-bottom: 16px;
  text-align: right;
}

.collab-form-card {
  background: var(--bg-form); padding: 40px 50px; border-radius: 2px;
}
.collab-form-card h2 {
  font-family: var(--font-heading);
  font-size: 16px; letter-spacing: 2px;
  text-transform: uppercase; text-align: center;
  margin-bottom: 30px; color: var(--text-muted); font-weight: 400;
}

.collab-form .form-row { margin-bottom: 14px; }
.collab-form .form-row input,
.collab-form .form-row textarea {
  width: 100%; padding: 14px 16px;
  border: none; background: var(--white);
  font-family: var(--font-body); font-size: 13px;
  color: var(--text); outline: none;
  transition: box-shadow 0.3s var(--ease);
  border-radius: 0; -webkit-appearance: none;
}
.collab-form .form-row input::placeholder,
.collab-form .form-row textarea::placeholder { color: #bbb; font-weight: 300; }
.collab-form .form-row input:focus,
.collab-form .form-row textarea:focus { box-shadow: 0 0 0 1.5px var(--black); }

.collab-form .form-submit { margin-top: 24px; }
.collab-form .form-submit button {
  width: 100%; padding: 16px;
  background: var(--black); color: var(--white);
  border: none; font-family: var(--font-body);
  font-size: 14px; letter-spacing: 1px;
  cursor: pointer; transition: background 0.3s var(--ease);
  border-radius: 0; -webkit-appearance: none;
}
.collab-form .form-submit button:hover { background: #333; }
.collab-form .form-submit button:disabled { background: #666; cursor: wait; }

.form-message { transition: opacity 0.3s var(--ease); }

/* ===================== STORY ===================== */
.page-story { padding: calc(var(--header-h) + 20px) 0 60px; min-height: 100vh; }

.story-wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

.story-top { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.story-top h1 {
  font-family: var(--font-heading);
  font-size: 20px; letter-spacing: 2px;
  text-transform: uppercase; font-weight: 400;
}

.story-dots { display: flex; gap: 6px; }
.story-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-muted); cursor: pointer;
  border: none; padding: 0; transition: background 0.3s;
}
.story-dot.is-active { background: var(--black); }

.story-card { display: none; }
.story-card.is-active {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 30px; align-items: start;
  animation: ncbeet-fadeIn 0.5s var(--ease);
}
@keyframes ncbeet-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.story-info { text-align: right; padding-top: 20px; }
.story-info h2 {
  font-family: var(--font-heading);
  font-size: 20px; letter-spacing: 1.5px;
  color: var(--text-muted); margin-bottom: 2px; font-weight: 400;
}
.story-info .story-date {
  font-family: var(--font-heading);
  font-size: 16px; color: var(--text-muted); margin-bottom: 20px;
}
.story-info .story-excerpt { font-size: 13px; line-height: 1.75; color: var(--text-muted); }

.story-thumb {
  aspect-ratio: 3/4; background: var(--bg-light);
  border-radius: 2px; overflow: hidden;
}
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }

.story-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding: 0 80px;
}
.story-arrow {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: opacity 0.25s;
}
.story-arrow:hover { opacity: 0.5; }
.story-arrow svg { width: 22px; height: 22px; stroke: var(--text); fill: none; stroke-width: 1.2; }

/* ===================== DEFAULT PAGE ===================== */
.page-default { padding: calc(var(--header-h) + 40px) 0 80px; min-height: 100vh; }
.page-default .page-content { max-width: 800px; margin: 0 auto; padding: 0 40px; }
.page-default .page-content h1 {
  font-family: var(--font-heading);
  font-size: 28px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 30px; font-weight: 400;
}
.page-default .page-content p { margin-bottom: 18px; line-height: 1.8; font-size: 15px; }

/* ===================== PLACEHOLDER / 404 ===================== */
.page-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; text-align: center;
}
.page-placeholder h1 {
  font-family: var(--font-heading);
  font-size: 32px; letter-spacing: 3px;
  color: var(--text-muted); font-weight: 400;
}
.page-placeholder p {
  font-family: var(--font-heading);
  font-size: 16px; letter-spacing: 1px;
  color: var(--text-muted); margin-top: 8px;
}

/* ===================== WP DEFAULTS ===================== */

/* reCAPTCHA v3 — hide floating badge (attribution in form footer) */
.grecaptcha-badge { visibility: hidden !important; }
.recaptcha-notice {
  font-size: 11px; color: var(--text-muted);
  text-align: center; margin-top: 14px; line-height: 1.5;
}
.recaptcha-notice a { text-decoration: underline; color: var(--text-muted); }
.alignleft  { float: left; margin-right: 1.5em; margin-bottom: 1em; }
.alignright { float: right; margin-left: 1.5em; margin-bottom: 1em; }
.aligncenter { display: block; margin: 0 auto 1.5em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.screen-reader-text {
  clip: rect(1px,1px,1px,1px); position: absolute !important;
  height: 1px; width: 1px; overflow: hidden; word-wrap: normal !important;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .site-header { padding: 0 24px; }
  .sidebar { width: var(--sidebar-w-mobile); }
  .sidebar-nav a { font-size: 20px; padding: 10px 0; }
  .gallery-wrap { padding: 0 20px; }
  .gallery-title { font-size: 14px; }

  .collab-wrap { grid-template-columns: 1fr; gap: 30px; padding: 0 24px; }
  .collab-intro { text-align: center; }
  .collab-intro p { text-align: center; }
  .collab-form-card { padding: 30px 24px; }

  .story-card.is-active { grid-template-columns: 1fr; gap: 20px; }
  .story-info { text-align: center; order: -1; }
  .story-wrap { padding: 0 24px; }
  .story-nav { padding: 0; }
  .story-top { justify-content: center; }

  .page-default .page-content { padding: 0 24px; }
}

@media (max-width: 480px) {
  :root { --header-h: 60px; }
  .sidebar-nav a { font-size: 18px; }
  .collab-intro h1 { font-size: 18px; }
}
