/* Melbourne Residence — residential community theme */
:root{
  --bg:#F5EFE4; --surface:#FCFAF5; --ink:#23272C; --muted:#6B6255;
  --accent:#7C5C26; --accent-ink:#5E441A; --accent-soft:#F0E6CE;
  --sand:#EFE3D2; --line:#E3D8C8;
  --maxw:1080px; --gap:16px; --radius:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;-webkit-overflow-scrolling:touch;scroll-behavior:smooth;overflow-x:hidden}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:17px;line-height:1.6;overflow-x:hidden}
main{flex:1 0 auto}
:lang(km){font-family:"Noto Sans Khmer",-apple-system,"Segoe UI",Roboto,sans-serif;line-height:1.85}
:lang(km) h1,:lang(km) h2,:lang(km) h3{font-family:"Noto Sans Khmer",sans-serif}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}
h1,h2,h3{line-height:1.25;font-weight:700;color:var(--ink);margin:0 0 .4em;font-family:"Noto Serif",Georgia,"Times New Roman",serif}
h1{font-size:2rem}h2{font-size:1.65rem}h3{font-size:1.2rem}
p{margin:0 0 1rem}
ul{margin:0;padding:0;list-style:none}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 var(--gap)}
.btn{display:inline-flex;align-items:center;gap:8px;font-size:.95rem;font-weight:700;padding:12px 24px;border-radius:50px;border:2px solid transparent;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.btn-primary{background:var(--accent);color:var(--bg);text-decoration:none;font-weight:500;white-space:nowrap;line-height:1.4;transition:opacity .15s ease;display:inline-block;padding:0.55rem 1.25rem;border-radius:999px}
.btn-primary:hover{opacity:0.88;text-decoration:none}
.btn-secondary{background:transparent;color:var(--accent);border-color:var(--accent)}
.btn-secondary:hover{background:var(--accent);color:#fff;text-decoration:none}

/* Header */
.site-header{background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:100}
.header-inner{max-width:var(--maxw);margin:0 auto;padding:12px var(--gap);display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{color:var(--ink);text-decoration:none}
.brand:hover{text-decoration:none}
.brand-wordmark{height:52px;width:auto;display:block}
@media (max-width:379.98px){.brand-wordmark{height:40px}}
@media (max-width:360px){.brand-wordmark{height:32px}}
.header-right{display:flex;align-items:center;gap:12px}
.nav-toggle{display:none;background:none;border:none;color:var(--ink);cursor:pointer;padding:9px}
.header-group{display:flex;align-items:center;gap:8px}
@media (max-width:480px){.header-inner{gap:4px;padding:12px 14px}.header-right{gap:4px}.nav-toggle{padding:6px}}
.nav-link{font-size:.88rem;font-weight:500;color:var(--ink);padding:6px 12px;border-radius:6px;transition:background .15s}
.nav-link:hover{background:var(--accent-soft);text-decoration:none}
.lang-dd{position:relative;cursor:pointer}
.lang-dd summary{list-style:none;font-size:.8rem;padding:4px 8px;border-radius:6px;user-select:none}
.lang-dd summary::-webkit-details-marker{display:none}
.lang-menu{position:absolute;right:0;top:100%;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:6px;box-shadow:0 4px 12px rgba(0,0,0,.08);z-index:50;min-width:120px}
.lang-switch{display:block;padding:6px 12px;font-size:.85rem;color:var(--ink);border-radius:4px;white-space:nowrap}
.lang-switch:hover{background:var(--accent-soft);text-decoration:none}
.lang-switch.active{font-weight:700;color:var(--accent)}
@media(max-width:720px){
  .nav-toggle{display:block}
  .header-group{display:none;position:absolute;top:100%;left:0;right:0;background:var(--surface);border-bottom:1px solid var(--line);flex-direction:column;padding:12px;gap:4px}
  .header-group.open{display:flex}
  .nav-link{display:block;padding:10px 16px;width:100%}
}

/* Hero */
.hero{background:var(--accent);color:var(--bg);padding:80px 0 64px;text-align:center}
.hero h1{color:#fff;font-size:2.4rem;margin-bottom:16px}
.hero-sub{font-size:1.15rem;opacity:.85;max-width:640px;margin:0 auto}

@media(max-width:720px){
  .hero{padding:40px 0 32px}
  .hero h1{font-size:1.8rem}
}

/* Sections */
.section{padding:48px 0}
.section-title{text-align:center;margin-bottom:32px}
.page-doc{padding:48px var(--gap) 0}
.page-body{max-width:720px;margin:0 auto}
.page-prose{max-width:720px;margin:0 auto}
.page-body p:last-child{margin-bottom:0}
.page-prose li{margin:0 0 .35rem}
.page-prose h1{margin-bottom:1rem}
.page-prose h2{margin-top:2rem}
.page-prose h2:first-child{margin-top:0}

@media(max-width:720px){
  .section{padding:32px 0}
}

/* Card grid */
.page-children{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;margin-top:24px}
.child-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:24px}
.child-card h3{margin-top:0}
.child-card h3 a{color:var(--ink);text-decoration:none}
.child-card h3 a:hover{color:var(--accent)}

/* Post */
.post{max-width:720px;margin:40px auto}
.post-title{margin-bottom:8px}

/* Footer */
.site-footer{background:var(--accent);color:var(--bg);padding:32px 0;margin-top:48px}
.footer-inner{max-width:var(--maxw);margin:0 auto;padding:0 var(--gap);text-align:center}
.footer-brand{font-size:1.1rem;font-weight:700;margin-bottom:4px;font-family:"Noto Serif",Georgia,serif}
.footer-addr{font-size:.85rem;opacity:.7;margin-bottom:16px}
.footer-bottom{font-size:.82rem;opacity:.6}

/* Theme toggle */
.theme-toggle{background:none;border:none;color:var(--ink);cursor:pointer;padding:4px;border-radius:6px;display:flex;align-items:center;transition:background .15s}
.theme-toggle:hover{background:var(--accent-soft)}
@media (max-width:480px){.theme-toggle{padding:11px;margin-right:6px}.lang-dd summary{padding:4px 6px}}
@media (max-width:360px){.lang-dd summary{font-size:.7rem}}
.theme-toggle .icon-sun{display:none}

/* ---- dark theme ---- */
:root[data-theme="dark"]{
  --bg:#1A1E23; --surface:#242A31; --ink:#EDE6D8; --muted:#A8A196;
  --accent:#C9A24E; --accent-ink:#E4C888; --accent-soft:#2A2416;
  --sand:#211C16; --line:#2D343B;
}
:root[data-theme="dark"] .theme-toggle .icon-moon{display:none}
:root[data-theme="dark"] .theme-toggle .icon-sun{display:block}
:root[data-theme="dark"] .hero{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .hero h1{color:var(--ink)}
:root[data-theme="dark"] .site-footer{background:var(--accent-soft);color:var(--ink)}

/* Photo section — featured image + thumbnail grid */
.photo-section{margin:2rem auto;max-width:var(--maxw)}
.photo-featured{border-radius:var(--radius);overflow:hidden;margin-bottom:12px}
/* Hero: cap at current source width (600px) so it never upscales.
   Raise max-width when a larger source is added. */
.photo-featured img{display:block;max-width:min(600px,100%);height:auto;margin:0 auto;border-radius:var(--radius)}
.photo-thumbnails{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.photo-thumb{border-radius:8px;overflow:hidden}
.photo-thumb img{width:100%;aspect-ratio:3/2;object-fit:cover;display:block;border-radius:8px;transition:opacity .15s;cursor:pointer}
.map-embed{position:relative;width:100%;aspect-ratio:16/9;border-radius:12px;overflow:hidden;margin:1.5rem 0}
.map-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.photo-thumb img:hover{opacity:.85}
@media(max-width:720px){.photo-thumbnails{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.photo-thumbnails{grid-template-columns:repeat(2,1fr);gap:6px}}

/* ---- blog: list cards ---- */
.news-cards{display:grid;gap:var(--gap)}
@media(min-width:600px){.news-cards{grid-template-columns:repeat(2,1fr)}}
@media(min-width:900px){.news-cards{grid-template-columns:repeat(3,1fr)}}
.news-card-item{overflow:hidden;padding:0;display:flex;flex-direction:column}
.news-card-img{display:block;overflow:hidden;aspect-ratio:16/9;background:var(--sand)}
.news-card-img img{width:100%;height:100%;object-fit:cover;transition:transform .2s}
.news-card-img:hover img{transform:scale(1.03)}
.news-card-body{padding:16px 20px 20px;flex:1;display:flex;flex-direction:column}
.news-card-body .meta{font-size:.78rem;color:var(--muted);margin-bottom:4px}
.news-card-body h3{font-size:1.05rem;margin-bottom:6px}
.news-card-body h3 a{color:var(--ink)}
.news-card-body h3 a:hover{color:var(--accent);text-decoration:none}
.news-card-body p{font-size:.88rem;color:var(--muted);margin-bottom:14px;flex:1}
.news-card-body .btn-sm{padding:7px 16px;font-size:.82rem;align-self:flex-start}
/* ---- blog: single post ---- */
.post .meta{text-align:center;font-size:.82rem;color:var(--muted);margin-bottom:24px}
.post-body{font-size:1.05rem;line-height:1.7;color:var(--ink)}
.post-body p{margin-bottom:1.2rem}
.post-body img{max-width:100%;border-radius:var(--radius);margin:16px 0}
.post-back{text-align:center;margin-top:32px;font-size:.88rem}
.post-video{margin:0 0 20px}
.yt-embed{display:block;width:100%;aspect-ratio:16/9;border:0;border-radius:var(--radius);margin:20px 0}
.video-caption{font-size:.9rem;color:var(--muted);text-align:center;margin-top:8px}
.btn-video{display:inline-block;background:var(--accent);color:#fff;padding:10px 18px;border-radius:var(--radius);text-decoration:none}
.btn-video::before{content:"\25B6";font-size:.8em;margin-right:7px}
.btn-video:hover{background:var(--accent-ink);color:#fff;text-decoration:none}
/* ---- blog: share bar ---- */
.post-share{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:32px;padding-top:20px;border-top:1px solid var(--line)}
.share-label{font-size:.82rem;color:var(--muted);margin-right:4px;font-weight:600}
.post-share a,.post-share button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--surface);border:1px solid var(--line);color:var(--muted);cursor:pointer;transition:background .15s,color .15s}
.post-share a:hover,.post-share button:hover{background:var(--accent-soft);color:var(--accent);text-decoration:none}
.post-share .share-copy.copied{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ---- homepage news feed ---- */
.news-card{background:var(--surface);border:1px dashed var(--line);border-radius:var(--radius);padding:32px 20px;text-align:center;color:var(--muted)}
.news-feed{display:grid;gap:var(--gap)}
@media(min-width:600px){.news-feed{grid-template-columns:repeat(3,1fr)}}
.news-feed-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;transition:box-shadow .15s}
.news-feed-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.08)}
.news-feed-card-img{display:block;aspect-ratio:16/10;overflow:hidden;background:var(--sand)}
.news-feed-card-img img{width:100%;height:100%;object-fit:cover}
.news-feed-card-body{padding:14px 16px 16px}
.news-feed-card-body .meta{font-size:.75rem;color:var(--muted);margin-bottom:3px}
.news-feed-card-body h3{font-size:.95rem;margin-bottom:2px}
.news-feed-card-body h3 a{color:var(--ink)}
.news-feed-card-body h3 a:hover{color:var(--accent);text-decoration:none}

/* ---- homepage photo lightbox ---- */
.photo-featured a,.photo-thumb a{display:block;cursor:pointer}
.gallery-overlay{position:fixed;inset:0;z-index:999;background:rgba(14,22,21,.92);display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s}
.gallery-overlay:target{opacity:1;pointer-events:auto}
.gallery-close{position:absolute;top:16px;right:20px;width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.15);color:#fff;font-size:1.6rem;line-height:40px;text-align:center;text-decoration:none}
.gallery-close:hover{background:rgba(255,255,255,.25);text-decoration:none}
.gallery-close::after{content:"\2715"}
.gallery-prev,.gallery-next{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:1rem;line-height:44px;text-align:center;text-decoration:none}
.gallery-prev{left:12px}.gallery-next{right:12px}
.gallery-prev::after{content:"\2039"}.gallery-next::after{content:"\203A"}
.gallery-prev:hover,.gallery-next:hover{background:rgba(255,255,255,.25);text-decoration:none}
.gallery-enlarged{max-width:92vw;max-height:88vh;border-radius:8px;box-shadow:0 4px 30px rgba(0,0,0,.5)}
