/*
Theme Name: MiniHobby Flexible
Theme URI: https://example.com/
Author: MiniHobby
Description: A lightweight, plugin-friendly WordPress theme for MiniHobby. Provides a default top navigation, flexible Gutenberg body area, default footer, and the dark teal/orange visual system from the supplied design reference.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: minihobby-flexible
*/

:root {
  --mh-bg: #08070D;
  --mh-surface: #111019;
  --mh-surface-alt: #1B1924;
  --mh-text: #F5F7FA;
  --mh-muted: #9AA3AF;
  --mh-teal: #1CBCD1;
  --mh-orange: #EB600C;
  --mh-border: #2C2A33;

  --mh-content: 1200px;
  --mh-wide: 1440px;
  --mh-gutter: clamp(20px, 4vw, 56px);

  --mh-radius-sm: 6px;
  --mh-radius: 10px;
  --mh-radius-lg: 16px;

  --mh-header-height: 72px;
  --mh-transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--mh-bg);
  color: var(--mh-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--mh-teal);
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--mh-orange);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--mh-text);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.75rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3.25rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 2rem); }

p {
  margin-top: 0;
}

/* Accessibility */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  clip: auto !important;
  width: auto;
  height: auto;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  margin: 0;
  z-index: 100000;
  background: var(--mh-text);
  color: var(--mh-bg);
  border-radius: var(--mh-radius-sm);
}

/* Shared containers */
.mh-container {
  width: min(calc(100% - (var(--mh-gutter) * 2)), var(--mh-content));
  margin-inline: auto;
}

.mh-wide-container {
  width: min(calc(100% - (var(--mh-gutter) * 2)), var(--mh-wide));
  margin-inline: auto;
}

/*
 * Flexible block layout:
 * ordinary top-level blocks use the content width,
 * alignwide uses the wider width,
 * alignfull can span the full viewport.
 */
.entry-content > :where(:not(.alignfull):not(.alignwide)),
.entry-header,
.post-navigation,
.comments-area {
  width: min(calc(100% - (var(--mh-gutter) * 2)), var(--mh-content));
  margin-inline: auto;
}

.entry-content > .alignwide {
  width: min(calc(100% - (var(--mh-gutter) * 2)), var(--mh-wide));
  margin-inline: auto;
}

.entry-content > .alignfull {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.entry-content {
  width: 100%;
}

.site-main {
  min-height: 50vh;
}

.mh-main-shell {
  width: 100%;
}

/* Default header / top menu */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  min-height: var(--mh-header-height);
  background: rgba(8, 7, 13, 0.96);
  border-bottom: 1px solid var(--mh-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mh-header-inner {
  min-height: var(--mh-header-height);
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr auto;
  align-items: center;
  gap: 28px;
}

.site-branding {
  min-width: 0;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  display: block;
  width: auto;
  max-height: 44px;
}

.site-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.site-title a {
  color: var(--mh-text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.site-description {
  margin: 3px 0 0;
  color: var(--mh-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.site-navigation {
  justify-self: center;
}

.primary-menu,
.footer-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-menu a,
.footer-menu a {
  color: var(--mh-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: color var(--mh-transition);
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  color: var(--mh-teal);
}

.mh-header-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.mh-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 8px;
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-sm);
  background: var(--mh-surface);
  color: var(--mh-text);
  cursor: pointer;
}

.mh-menu-toggle__line {
  display: block;
  width: 21px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  transition: transform var(--mh-transition), opacity var(--mh-transition);
}

/* Page shell */
.mh-page-header {
  padding-top: clamp(42px, 7vw, 90px);
  padding-bottom: 24px;
}

.entry-title {
  margin-bottom: 0;
}

.entry-content {
  padding-bottom: clamp(56px, 8vw, 110px);
}

.mh-front-page .entry-content {
  padding-bottom: 0;
}

.mh-page--title-hidden > .entry-content {
  padding-top: 0;
}

/* Core block defaults only; plugins remain free to own their own component CSS. */
.wp-block-button__link,
.wp-element-button {
  min-height: 44px;
  padding: 11px 22px;
  border: 1px solid var(--mh-orange);
  border-radius: var(--mh-radius-sm);
  background: var(--mh-orange);
  color: var(--mh-text);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--mh-transition), filter var(--mh-transition);
}

.wp-block-button__link:hover,
.wp-element-button:hover {
  color: var(--mh-text);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

input,
select,
textarea {
  max-width: 100%;
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-sm);
  background: var(--mh-surface);
  color: var(--mh-text);
}

input,
select {
  min-height: 44px;
  padding: 8px 12px;
}

textarea {
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--mh-teal);
  outline-offset: 1px;
}

/* Default footer area */
.site-footer {
  background: var(--mh-surface);
  border-top: 1px solid var(--mh-border);
}

.mh-footer-main {
  min-height: 150px;
  padding-block: 42px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr);
  align-items: start;
  gap: 40px;
}

.mh-footer-brand .site-title {
  margin-bottom: 8px;
}

.mh-footer-brand p {
  max-width: 420px;
  margin-bottom: 0;
  color: var(--mh-muted);
  font-size: 0.88rem;
}

.mh-footer-nav {
  display: flex;
  justify-content: flex-end;
}

.footer-menu {
  justify-content: flex-end;
}

.footer-menu a:hover,
.footer-menu a:focus,
.footer-menu .current-menu-item > a,
.footer-menu .current_page_item > a {
  color: var(--mh-teal);
}

.mh-footer-bottom {
  padding-block: 18px;
  border-top: 1px solid var(--mh-border);
  color: var(--mh-muted);
  font-size: 0.78rem;
}

/* Simple posts / archives */
.mh-post-list {
  padding-block: clamp(42px, 7vw, 88px);
}

.mh-post-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--mh-border);
}

.mh-post-card:first-child {
  padding-top: 0;
}

.mh-post-card__title {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.mh-post-card__title a {
  color: var(--mh-text);
  text-decoration: none;
}

.mh-post-card__title a:hover {
  color: var(--mh-teal);
}

.mh-post-meta {
  margin-bottom: 12px;
  color: var(--mh-muted);
  font-size: 0.8rem;
}

/* Full-width template */
.page-template-template-full-width .entry-content > :where(:not(.alignfull):not(.alignwide)) {
  width: min(calc(100% - (var(--mh-gutter) * 2)), var(--mh-wide));
}

/* Optional canvas template removes theme chrome entirely. */
.page-template-template-canvas {
  min-height: 100vh;
}

.page-template-template-canvas .entry-content {
  padding-bottom: 0;
}

/* WooCommerce compatibility without imposing a custom shop design. */
.woocommerce .site-main {
  width: min(calc(100% - (var(--mh-gutter) * 2)), var(--mh-content));
  margin-inline: auto;
  padding-block: 48px;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  border-radius: var(--mh-radius-sm);
}

/* Mobile navigation */
@media (max-width: 900px) {
  .mh-header-inner {
    grid-template-columns: 1fr auto;
    gap: 18px;
  }

  .mh-menu-toggle {
    display: block;
  }

  .site-navigation {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
    padding: 0 0 18px;
  }

  .site-navigation.is-open {
    display: block;
  }

  .primary-menu {
    display: grid;
    gap: 0;
    padding: 8px 0;
    border-top: 1px solid var(--mh-border);
  }

  .primary-menu li {
    border-bottom: 1px solid var(--mh-border);
  }

  .primary-menu a {
    display: block;
    padding: 13px 2px;
  }

  .mh-header-end {
    grid-column: 2;
    grid-row: 1;
  }

  .mh-footer-main {
    grid-template-columns: 1fr;
  }

  .mh-footer-nav,
  .footer-menu {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  :root {
    --mh-gutter: 18px;
  }

  .site-description {
    display: none;
  }

  .footer-menu {
    display: grid;
    gap: 10px;
  }
}
