/* Lyncs Media Starter – main.css
   Structural baseline. Brand tokens (--brand-primary, --brand-accent,
   --font-heading, --font-body) are defined in brand.css, loaded first. */

/* --- Structural custom properties --- */
:root {
  --color-bg:      #ffffff;
  --color-surface: #f7f7f7;
  --color-border:  #e0e0e0;
  --color-text:    #1a1a1a;
  --color-muted:   #636363;
  --max-width:     1100px;
  --space-xs:      0.5rem;
  --space-sm:      1rem;
  --space-md:      2rem;
  --space-lg:      4rem;
  --radius:        4px;
  --ease:          180ms ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); font-size: 1rem; line-height: 1.7; color: var(--color-text); background: var(--color-bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-primary); text-decoration-skip-ink: auto; }
a:hover { color: var(--brand-accent); }

/* Skip link */
.skip-link { position: absolute; top: -999px; left: var(--space-sm); background: var(--brand-primary); color: #fff; padding: .5em 1em; border-radius: 0 0 var(--radius) var(--radius); text-decoration: none; font-weight: 600; z-index: 9999; }
.skip-link:focus { top: 0; }

/* --- Layout --- */
.container { width: 100%; max-width: var(--max-width); margin-inline: auto; padding-inline: var(--space-sm); }
.section { padding-block: var(--space-lg); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
.prose h2, .prose h3 { margin-top: var(--space-md); margin-bottom: var(--space-xs); }
.prose p, .prose ul, .prose ol { margin-bottom: var(--space-sm); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin-bottom: .25em; }
.prose strong { font-weight: 600; }
.prose a { text-decoration: underline; }
.prose blockquote { border-left: 3px solid var(--brand-accent); margin-left: 0; padding-left: var(--space-sm); color: var(--color-muted); font-style: italic; }

/* --- Buttons --- */
.btn { display: inline-block; padding: .65em 1.5em; border-radius: var(--radius); font-family: var(--font-heading); font-weight: 600; text-decoration: none; cursor: pointer; transition: opacity var(--ease), background var(--ease); border: 2px solid transparent; }
.btn:hover { opacity: .88; }
.btn--primary { background: var(--brand-primary); color: #fff; }
.btn--secondary { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); }
.btn--secondary:hover { background: var(--brand-primary); color: #fff; opacity: 1; }

/* --- Header --- */
.site-header { background: var(--color-bg); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 3.75rem; }
.site-logo { display: flex; align-items: center; text-decoration: none; }
.site-logo img { max-height: 2.5rem; width: auto; }
.site-logo__text { font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; color: var(--brand-primary); }

/* Hamburger */
.nav-toggle { display: flex; flex-direction: column; justify-content: space-between; width: 1.5rem; height: 1.125rem; background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.nav-toggle__bar { display: block; height: 2px; background: var(--brand-primary); border-radius: 1px; }

/* Nav mobile */
.primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: var(--space-xs) var(--space-sm); }
.primary-nav--open { display: block; }
.nav-list { list-style: none; }
.nav-item { border-bottom: 1px solid var(--color-border); }
.nav-item:last-child { border-bottom: none; }
.nav-link { display: flex; align-items: center; gap: .25em; padding: .6rem 0; text-decoration: none; color: var(--color-text); font-weight: 500; }
.nav-link--active { color: var(--brand-primary); font-weight: 700; }
.nav-link:hover { color: var(--brand-accent); }
.nav-arrow { font-size: .7em; }
.nav-dropdown { display: none; list-style: none; padding-left: var(--space-sm); }
.nav-item--dropdown-open .nav-dropdown { display: block; }
.nav-dropdown__link { display: block; padding: .4rem 0; text-decoration: none; color: var(--color-muted); font-size: .9rem; }
.nav-dropdown__link:hover { color: var(--brand-accent); }
.nav-dropdown__link.nav-link--active { color: var(--brand-primary); font-weight: 600; }

/* Nav desktop */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .primary-nav { display: block !important; position: static; background: none; border: none; padding: 0; }
  .nav-list { display: flex; align-items: center; }
  .nav-item { border-bottom: none; position: relative; }
  .nav-link { padding: .25rem .75rem; }
  .nav-dropdown { position: absolute; top: calc(100% + .25rem); left: 0; min-width: 200px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.1); padding: var(--space-xs) 0; z-index: 10; }
  .nav-item--has-dropdown:hover .nav-dropdown { display: block; }
  .nav-dropdown__link { padding: .45rem var(--space-sm); white-space: nowrap; }
}

/* --- Hero --- */
.hero { background: var(--brand-primary); color: #fff; padding-block: var(--space-lg); text-align: center; }
.hero .container { max-width: 760px; }
.hero__heading { color: #fff; margin-bottom: var(--space-sm); }
.hero__subhead { font-size: 1.15rem; opacity: .85; margin-bottom: var(--space-md); max-width: 600px; margin-inline: auto; }
.hero .btn--primary { background: var(--brand-accent); border-color: var(--brand-accent); }

/* --- Section heading --- */
.section__heading { margin-bottom: var(--space-md); text-align: center; }

/* --- Card grid --- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__image { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card__body { padding: var(--space-sm); display: flex; flex-direction: column; flex: 1; }
.card__tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-accent); margin-bottom: var(--space-xs); }
.card__title { font-size: 1.05rem; margin-bottom: var(--space-xs); }
.card__title a { text-decoration: none; color: inherit; }
.card__title a:hover { color: var(--brand-accent); }
.card__excerpt { font-size: .9rem; color: var(--color-muted); margin-bottom: var(--space-sm); flex: 1; }
.card__link { font-size: .875rem; font-weight: 600; text-decoration: none; color: var(--brand-primary); margin-top: auto; }
.card__link:hover { color: var(--brand-accent); }

/* --- Testimonials --- */
.testimonial-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 640px)  { .testimonial-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .testimonial-grid { grid-template-columns: repeat(3, 1fr); } }
.testimonial { background: var(--color-surface); border-left: 3px solid var(--brand-accent); padding: var(--space-sm); border-radius: 0 var(--radius) var(--radius) 0; }
.testimonial__quote { font-style: italic; margin-bottom: var(--space-xs); }
.testimonial__attribution { font-size: .85rem; color: var(--color-muted); }

/* --- CTA band --- */
.section--cta { background: var(--color-surface); text-align: center; border-top: 1px solid var(--color-border); }
.cta__heading { margin-bottom: var(--space-xs); }
.cta__body { color: var(--color-muted); margin-bottom: var(--space-md); }

/* --- Page content --- */
.page-header { padding-block: var(--space-lg) var(--space-md); border-bottom: 2px solid var(--brand-primary); margin-bottom: var(--space-md); }
.page-header__subtitle { color: var(--color-muted); font-size: 1.1rem; margin-top: var(--space-xs); }
.page-content { padding-block: var(--space-md) var(--space-lg); }

/* --- Featured case study (homepage) --- */
.featured-case-study { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-md); max-width: 640px; margin-inline: auto; }
.featured-case-study__title { margin-bottom: var(--space-xs); }
.featured-case-study__title a { text-decoration: none; color: inherit; }
.featured-case-study__title a:hover { color: var(--brand-accent); }
.featured-case-study p { margin-bottom: var(--space-sm); color: var(--color-muted); }

/* --- Blog index --- */
.category-nav { margin-block: var(--space-sm) var(--space-md); }
.category-nav__list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.category-nav__link { display: inline-block; padding: .3em .9em; border-radius: 2rem; font-size: .85rem; text-decoration: none; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text); transition: background var(--ease), color var(--ease); }
.category-nav__link--active, .category-nav__link:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.post-list { display: flex; flex-direction: column; gap: var(--space-md); padding-block: var(--space-md) var(--space-lg); }
.post-card { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 1fr; }
@media (min-width: 600px) { .post-card { grid-template-columns: 220px 1fr; } }
.post-card__image { width: 100%; height: 160px; object-fit: cover; }
.post-card__body { padding: var(--space-sm); }
.post-card__meta { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--color-muted); margin-bottom: var(--space-xs); }
.post-card__cat a { color: var(--brand-accent); text-decoration: none; font-weight: 600; }
.post-card__title { font-size: 1.1rem; margin-bottom: var(--space-xs); }
.post-card__title a { text-decoration: none; color: inherit; }
.post-card__title a:hover { color: var(--brand-accent); }
.post-card__excerpt { font-size: .9rem; color: var(--color-muted); margin-bottom: var(--space-xs); }
.post-card__read-more { font-size: .875rem; font-weight: 600; color: var(--brand-primary); text-decoration: none; }
.post-card__read-more:hover { color: var(--brand-accent); }

/* --- Blog post & case study --- */
.blog-post, .case-study { padding-block: var(--space-md) var(--space-lg); }
.blog-post__header, .case-study__header { margin-bottom: var(--space-md); }
.blog-post__meta, .case-study__meta { display: flex; flex-wrap: wrap; gap: var(--space-sm); font-size: .85rem; color: var(--color-muted); margin-bottom: var(--space-xs); }
.blog-post__cat a, .case-study__type { color: var(--brand-accent); font-weight: 600; text-decoration: none; }
.blog-post__title, .case-study__title { margin-bottom: var(--space-xs); }
.case-study__intro { color: var(--color-muted); font-size: 1.1rem; }
.blog-post__featured-image, .case-study__image { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--radius); margin-bottom: var(--space-md); }
.blog-post__content, .case-study__content { max-width: 720px; }
.blog-post__footer, .case-study__footer { margin-top: var(--space-md); padding-top: var(--space-sm); border-top: 1px solid var(--color-border); }
.back-link { font-size: .9rem; color: var(--color-muted); text-decoration: none; }
.back-link:hover { color: var(--brand-primary); }

/* --- 404 --- */
.error-page { padding-block: var(--space-lg); text-align: center; }
.error-page__code { font-size: clamp(4rem, 10vw, 7rem); color: var(--color-border); line-height: 1; }
.error-page__heading { margin-bottom: var(--space-sm); }
.error-page__body { color: var(--color-muted); margin-bottom: var(--space-md); }

/* --- Empty state --- */
.empty-state { color: var(--color-muted); font-style: italic; padding-block: var(--space-md); text-align: center; }

/* --- Footer --- */
.site-footer { background: var(--brand-primary); color: rgba(255,255,255,.8); padding-block: var(--space-lg); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }
@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.footer-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); margin-bottom: var(--space-xs); }
.footer-brand__name { font-weight: 700; font-size: 1.05rem; color: #fff; margin-bottom: var(--space-xs); }
.footer-brand__address { font-size: .9rem; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.social-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.footer-legal { border-top: 1px solid rgba(255,255,255,.15); padding-top: var(--space-sm); display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: space-between; align-items: center; font-size: .85rem; color: rgba(255,255,255,.45); }
.policy-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.footer-legal a { color: rgba(255,255,255,.55); }
.footer-legal a:hover { color: #fff; }
