/*
Theme Name: Styl Chen
Theme URI: http://stylchen.local
Description: A maintainable WordPress rebuild of the Styl Chen legacy site.
Version: 1.0.0
Author: Styl Chen
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: stylchen
*/

/* Global layer: design tokens, typography, header, footer.
   Everything here is on every page; page-specific rules live in assets/css/. */

/* --- Design tokens --------------------------------------------------- */
:root {
  --sc-red: #a11f2b;
  --sc-red-dark: #7c1721;
  --sc-ink: #262626;
  --sc-muted: #777;
  --sc-line: #e8e8e8;
  --sc-footer: #171717;
  --sc-content: 1170px;
}

/* --- Reset and base typography --------------------------------------- */
* { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; } /* 100% keeps 1rem at the reader's preferred size */
body {
  margin: 0;
  color: var(--sc-muted);
  background: #fff;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.7;
}
a { color: var(--sc-red); text-decoration: none; }
a:hover, a:focus { color: var(--sc-red-dark); }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: min(calc(100% - 30px), var(--sc-content)); margin-inline: auto; }

/* --- Site header and primary navigation ------------------------------ */
.site-header { position: sticky; top: 0; z-index: 50; min-height: 90px; border-bottom: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.home .site-header { position: fixed; right: 0; left: 0; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 90px; }
.site-brand { display: inline-flex; align-items: center; color: var(--sc-ink); font-family: "Open Sans", Arial, sans-serif; font-size: 1.25rem; font-weight: 700; letter-spacing: .04em; }
.site-brand img, .site-brand .custom-logo { display: block; width: auto; max-width: 100%; height: auto; max-height: 70px; }
.primary-menu { display: flex; align-items: stretch; gap: 0; margin: 0; padding: 0; list-style: none; }
.primary-menu > li { position: relative; }
.primary-menu a { display: flex; align-items: center; height: 90px; padding: 0 16px; color: #888; font-family: "Open Sans", Arial, sans-serif; font-size: 0.9375rem; font-weight: 400; text-transform: uppercase; }
.primary-menu a:hover, .primary-menu .current-menu-item > a, .primary-menu .current-menu-ancestor > a { color: var(--sc-red); }
.primary-menu > .menu-item-has-children > a::after { width: 7px; height: 7px; margin: -4px 0 0 8px; border: solid currentColor; border-width: 0 1px 1px 0; content: ""; transform: rotate(45deg); }
.primary-menu .sub-menu { position: absolute; top: 100%; left: 0; display: none; min-width: 220px; margin: 0; border-top: 3px solid var(--sc-red); padding: 5px 0; background: #fff; box-shadow: 0 7px 20px rgba(0,0,0,.12); list-style: none; }
.primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu { display: block; }
.primary-menu .sub-menu a { height: auto; padding: 10px 22px; color: #666; font-size: 0.8125rem; font-weight: 600; text-transform: none; white-space: nowrap; transition: padding .2s ease,color .2s ease; }
.primary-menu .sub-menu a:hover, .primary-menu .sub-menu a:focus { padding-left: 27px; color: var(--sc-red); }
.primary-menu .sub-menu .current-menu-item > a { color: var(--sc-red); }
/* Three grey bars, as on the previous site. */
.menu-toggle { display: none; width: 60px; height: 46px; margin-right: -15px; border: 0; padding: 0; background: transparent; }
.menu-toggle:hover, .menu-toggle:focus-visible { border: 0; background: transparent; }
.menu-toggle__bar { display: block; width: 20px; height: 3px; margin: 3.5px auto; background: #777; }
.submenu-toggle { display: none; }

/* --- Buttons and section rhythm -------------------------------------- */
.button, button, input[type=submit] { display: inline-block; border: 1px solid var(--sc-red); padding: 10px 24px; background: var(--sc-red); color: #fff; font: inherit; cursor: pointer; }
.button:hover, button:hover, input[type=submit]:hover { border-color: var(--sc-red-dark); background: var(--sc-red-dark); color: #fff; }
.section { padding: 68px 0; }
.section--muted { background: #fafafa; }

/* --- Page header banner ------------------------------------------------ */
/* One hero for every view. The four per-view variants this replaced differed
   only in gradient, title size and a few pixels of padding, and were dead in
   practice: .page-hero.has-pattern outranks them and a pattern is the default.
   Real variation now comes from the admin controls below. */
.page-hero { padding: 58px 0 54px; background: linear-gradient(rgba(45,30,30,.45),rgba(45,30,30,.45)), linear-gradient(120deg,#8a7470,#37292a); color: #fff; text-align: center; }
/* Title and breadcrumbs follow the previous site: plain sans-serif capitals,
   crumbs without separators and the current one in red. */
.page-hero h1 { margin: 0; color: inherit; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 2.75rem; font-weight: 400; line-height: 1.43; text-transform: uppercase; overflow-wrap: anywhere; }
.page-hero__crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: inherit; font-size: 0.875rem; }
.page-hero__crumbs a { color: inherit; }
.page-hero__crumbs > span[aria-hidden] { display: none; }
.page-hero .page-hero__crumbs > :last-child { color: #c9043b; }
.page-hero--caps h1 { text-transform: uppercase; }

/* The dragon drawing ships once as white line art with alpha; the colour comes
   from --hero-bg and the drawing is lightened onto it at --hero-line-opacity.
   Two classes so these win over the per-view hero backgrounds in assets/css/. */
.page-hero.has-pattern { position: relative; isolation: isolate; overflow: hidden; background: var(--hero-bg); }
/* --hero-parallax is set by assets/js/page-hero.js while scrolling. */
.page-hero.has-pattern::before { position: absolute; z-index: -1; inset: 0; background-image: var(--hero-pattern); background-position: center; background-size: cover; opacity: var(--hero-line-opacity); content: ""; transform: translate3d(0, var(--hero-parallax, 0px), 0); will-change: transform; }
.page-hero.has-pattern::after { position: absolute; z-index: -1; inset: 0; content: ""; }
.page-hero.has-pattern.overlay-light::after { background: rgba(255,255,255,.8); }
.page-hero.has-pattern.overlay-dark::after { background: rgba(0,0,0,.2); }
.page-hero.has-pattern.text-light, .page-hero.has-pattern.text-light h1 { color: #fff; }
.page-hero.has-pattern.text-light a { color: #fff; }
.page-hero.has-pattern.text-dark, .page-hero.has-pattern.text-dark h1 { color: var(--sc-ink); }
.page-hero.has-pattern.text-dark a { color: #555; }

/* --- Site footer ------------------------------------------------------ */
.site-footer { padding: 70px 0 0; background: #151515; color: #808080; }
.site-footer h2, .site-footer h3 { margin: 0 0 20px; color: #fff; font-family: "Open Sans", Arial, sans-serif; font-size: 1.125rem; font-weight: 500; }
.site-footer p { margin: 0 0 15px; }
.footer-logo { display: block; width: auto; max-width: 205px; height: auto; margin: 0 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 45px; border-bottom: 1px solid rgba(255,255,255,.12); padding-bottom: 40px; }
.site-footer a { color: #808080; }
.site-footer a:hover, .site-footer a:focus { color: #666; }
.footer-recent-post { display: flex; gap: 10px; margin: 0 0 10px; }
.footer-recent-post__thumb { flex: 0 0 75px; }
.footer-recent-post__thumb img { display: block; width: 75px; height: 55px; object-fit: cover; }
.footer-recent-post h4 { margin: 0 0 5px; font-size: 0.875rem; font-weight: 500; line-height: 1.4; }
.footer-recent-post h4 a { color: #ddd; }
.footer-recent-post h4 a:hover, .footer-recent-post h4 a:focus { color: var(--sc-red); }
.footer-recent-post time { font-size: 0.75rem; line-height: 1.3; }
.footer-opening-hours p { padding: 10px 0; font-weight: 700; }
.footer-contact-links { margin: 0; padding: 0; list-style: none; }
.footer-contact-links li { display: flex; align-items: center; gap: 5px; }
.footer-contact-links svg { flex: 0 0 auto; width: 14px; height: 14px; fill: #c9043b; }
/* Full-width darker strip at the bottom of the footer, as on the previous site. */
.site-footer { display: flex; flex-direction: column; }
.site-footer__bottom { margin-top: auto; background: #121212; }
.site-footer__bottom .container { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 0; font-size: 0.8125rem; }
.social-icons { display: flex; gap: 7px; margin: 0; padding: 0; list-style: none; }
.site-footer .social-icons a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #333; color: #eee; transition: background-color .3s ease; }
.site-footer .social-icons a:hover, .site-footer .social-icons a:focus-visible { background: #555; color: #fff; }
.social-icons svg { width: 13px; height: 13px; fill: currentColor; }

/* --- Back-to-top button ----------------------------------------------- */
.scroll-top { position: fixed; right: 15px; bottom: 15px; z-index: 99; display: grid; place-items: center; width: 50px; height: 50px; background: rgba(0,0,0,.1); color: #fff; opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s ease, background-color .2s ease; }
.scroll-top.is-visible { opacity: 1; visibility: visible; }
.scroll-top:hover, .scroll-top:focus-visible { background: rgba(0,0,0,.6); color: #fff; }
.scroll-top svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; }
html:not(.cookie-notice-dismissed) .scroll-top { bottom: calc(15px + var(--cookie-notice-height, 0px)); }

/* --- Cookie information bar (previous site's look) --------------------- */
.cookie-notice { position: fixed; right: 0; bottom: 0; left: 0; z-index: 98; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; width: min(100%, 980px); margin-inline: auto; border: 1px solid #fff; border-bottom: 0; border-radius: 4px 4px 0 0; padding: 12px 15px; background: #bababa; color: #fff; font-size: 0.875rem; font-weight: 600; line-height: 1.4; text-align: center; }
.cookie-notice-dismissed .cookie-notice { display: none; }
.cookie-notice p { margin: 0; }
.cookie-notice a, .cookie-notice a:hover { color: #fff; text-decoration: underline; }
.cookie-notice__button, .cookie-notice__button:hover, .cookie-notice__button:focus-visible { border: 1px solid #fff; border-radius: 3px; padding: 2px 8px; background: #fff; color: #005a00; font-size: 0.875rem; font-weight: 600; }
.cookie-notice__button:hover, .cookie-notice__button:focus-visible { background: #f0f0f0; }

@media (max-width: 900px) {
  /* Drop-down panel like the previous site's: full width under the header,
     bordered rows, an arrow box on parents, submenus that slide open. */
  .menu-toggle { display: block; margin-left: auto; }
  .primary-menu { position: absolute; top: 100%; right: 0; left: 0; display: none; flex-direction: column; max-height: min(400px, calc(100vh - 90px)); overflow-y: auto; background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,.15); }
  .primary-menu.is-open, .primary-menu.is-closing { display: flex; }
  .primary-menu > li:first-child { border-top: 1px solid #f0f0f0; }
  .primary-menu a { display: block; height: auto; border-bottom: 1px solid #f0f0f0; padding: 12px 20px; line-height: 1.43; }
  .primary-menu > .menu-item-has-children > a { padding-right: 70px; }
  .primary-menu > .menu-item-has-children > a::after { display: none; }
  .submenu-toggle { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 60px; height: 46px; border: 0; border-left: 1px solid #f5f5f5; padding: 0; background: transparent; color: #888; }
  .submenu-toggle:hover, .submenu-toggle:focus-visible { border: 0; border-left: 1px solid #f5f5f5; background: transparent; color: #333; }
  .submenu-toggle::before { width: 9px; height: 9px; margin-top: -5px; border: solid currentColor; border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg); }
  .primary-menu .sub-menu { position: static; display: none; min-width: 0; border-top: 0; padding: 0; box-shadow: none; }
  .primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu { display: none; }
  .primary-menu li > .sub-menu.is-open, .primary-menu li > .sub-menu.is-closing { display: block; }
  .primary-menu .sub-menu a { padding: 12px 20px 12px 40px; color: #555; white-space: normal; }
  .primary-menu .sub-menu a:hover, .primary-menu .sub-menu a:focus { padding-left: 50px; }
}
@media (max-width: 767px) {
  /* The previous site's phone header: 50px bar, 30px logo. */
  .site-header, .site-header__inner { min-height: 50px; }
  .site-brand img, .site-brand .custom-logo { max-height: 30px; }
  .primary-menu { max-height: min(400px, calc(100vh - 50px)); }
}
@media (max-width: 560px) {
  .section { padding: 48px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .site-footer__bottom .container { flex-direction: column; }
}
