/* ==========================================================================
   YCALEX - Main Stylesheet
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-text-muted: #555555;
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-submit: #066aab;
  --color-submit-hover: #05558a;
  --color-border: #cccccc;
  --color-error: #b91c1c;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-max-width: 680px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--color-accent);
}

/* Accessibility: Skip Link & Focus Outlines */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  background-color: var(--color-text);
  color: var(--color-bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Layout Structure (Desktop Default >= 960px)
   ========================================================================== */

.site-container {
  display: flex;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 48px 36px;
  gap: 64px;
}

.site-header {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-logo {
  display: inline-block;
  margin-bottom: 36px;
  text-decoration: none;
}

.menu-toggle,
.mobile-nav-header {
  display: none;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-list a {
  text-decoration: none;
  font-size: 1.05rem;
  color: var(--color-text);
  transition: color 0.15s ease;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-main {
  flex: 1;
}

/* ==========================================================================
   Home Hero
   ========================================================================== */

.home-hero {
  padding-top: 18vh;
  padding-bottom: 12vh;
  max-width: 820px;
}

.home-title {
  margin: 0 0 32px;
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.btn-pill {
  display: inline-block;
  padding: 14px 30px;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 9999px;
  transition: background-color 0.15s ease;
}

.btn-pill:hover {
  background-color: var(--color-accent-hover);
  color: #ffffff;
}

/* ==========================================================================
   Standard Pages & Typography
   ========================================================================== */

.page-content,
.post-article {
  max-width: var(--content-max-width);
}

.page-title {
  margin: 0 0 32px;
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-content h2 {
  margin: 40px 0 16px;
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.page-content h3 {
  margin: 28px 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

.page-content p {
  margin: 0 0 20px;
}

.page-content ul {
  margin: 0 0 24px;
  padding-left: 22px;
}

.page-content li {
  margin-bottom: 10px;
}

.page-cta {
  margin-top: 28px;
}

/* ==========================================================================
   Blog Index & Single Post
   ========================================================================== */

.blog-intro {
  margin: 0 0 36px;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  margin-bottom: 40px;
}

.post-item-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 400;
}

.post-item-title a {
  text-decoration: underline;
}

.post-excerpt {
  margin: 0;
}

.read-more {
  display: inline-block;
  margin-left: 4px;
}

.post-header {
  margin-bottom: 28px;
}

.post-date {
  display: block;
  margin-bottom: 12px;
  color: var(--color-accent);
  font-size: 1.05rem;
  font-weight: 500;
}

.post-title {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.post-content p {
  margin: 0 0 20px;
}

.post-content ul {
  margin: 0 0 24px;
  padding-left: 20px;
}

.post-content li {
  margin-bottom: 10px;
}

.post-dividers {
  margin-top: 64px;
}

.post-divider {
  border: 0;
  height: 4px;
  margin: 24px 0;
  background-image: radial-gradient(circle, #cccccc 1px, transparent 1.2px);
  background-size: 6px 4px;
}

/* ==========================================================================
   Contact Form
   ========================================================================== */

.contact-form {
  margin-top: 28px;
  max-width: 540px;
}

.form-error-summary {
  display: none;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-left: 4px solid var(--color-error);
  background-color: #fef2f2;
  color: var(--color-error);
  font-size: 0.95rem;
}

.form-error-summary.is-visible {
  display: block;
}

.form-group {
  margin-bottom: 22px;
}

.form-label,
.form-legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.form-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.required-star {
  color: #d63638;
  margin-left: 2px;
}

.name-row {
  display: flex;
  gap: 16px;
}

.name-col {
  flex: 1;
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background-color: #ffffff;
  border: 1px solid #8c8f94;
  border-radius: 2px;
}

.form-control:focus {
  border-color: var(--color-submit);
  outline: 2px solid rgba(6, 106, 171, 0.25);
  outline-offset: 0;
}

.form-control.has-error {
  border-color: var(--color-error);
}

.sublabel {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.field-error-text {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--color-error);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-submit {
  display: inline-block;
  padding: 10px 18px;
  background-color: var(--color-submit);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-submit:hover {
  background-color: var(--color-submit-hover);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 96px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
}

.footer-copy,
.footer-credit {
  margin: 0;
}

.footer-copy {
  font-weight: 700;
}

.footer-copy a {
  text-decoration: none;
  margin-left: 6px;
}

.footer-copy a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Tablet Layout (600px - 959px)
   ========================================================================== */

@media (max-width: 959px) {
  .site-container {
    flex-direction: column;
    padding: 32px 32px 28px;
    gap: 48px;
  }

  .site-header {
    flex: none;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 28px;
  }

  .site-logo {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .site-logo img {
    width: 68px;
    height: auto;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }

  .nav-list a {
    font-size: 0.95rem;
  }

  .home-hero {
    padding-top: 14vh;
    padding-bottom: 10vh;
  }
}

/* ==========================================================================
   Mobile Layout (< 600px)
   ========================================================================== */

@media (max-width: 599px) {
  .site-container {
    padding: 24px 24px 28px;
    gap: 32px;
  }

  .site-header {
    justify-content: flex-start;
  }

  .site-logo {
    display: none;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 36px;
    height: 36px;
    padding: 4px;
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .hamburger-line {
    display: block;
    width: 24px;
    height: 1.5px;
    background-color: var(--color-text);
  }

  /* Full-Screen Mobile Navigation Overlay */
  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background-color: var(--color-bg);
    padding: 24px 28px;
    flex-direction: column;
    overflow-y: auto;
  }

  .site-nav.is-open {
    display: flex;
  }

  .mobile-nav-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 36px;
  }

  .menu-close {
    align-self: flex-end;
    background: transparent;
    border: 0;
    padding: 4px 8px;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
    margin-bottom: 16px;
  }

  .mobile-nav-logo {
    display: inline-block;
    text-decoration: none;
  }

  .nav-list {
    flex-direction: column;
    gap: 24px;
  }

  .nav-list a {
    font-size: 1.35rem;
  }

  .home-hero {
    padding-top: 8vh;
    padding-bottom: 8vh;
  }

  .name-row {
    flex-direction: column;
    gap: 14px;
  }

  .site-footer {
    margin-top: 64px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}