/* =====================================================================
   Tayrex CMS — stylesheet
   ===================================================================== */

:root {
    /* brand palette */
    --cobalt:    #0b2e6f;   /* deep brand blue — hero, footer, headings */
    --cobalt-d:  #082451;   /* darker cobalt                            */
    --blue:      #1a56db;   /* interactive blue — links, focus          */
    /* --cinnabar:  #e0392b;   / * red accent                               * / */
    --cinnabar:  red;   /* red accent                               */
    /* --cadmium:   #f3701f;   / * orange accent / primary CTA              * / */
    --cadmium:   #F08A00;   /* orange accent / primary CTA              */

    /* neutrals */
    --ink:       #0f1b2d;   /* primary text                             */
    --slate:     #586377;   /* muted text                               */
    --cloud:     #f4f7fc;   /* tinted section background                */
    --paper:     #ffffff;
    --line:      #e3e8f1;   /* hairlines / card borders                 */
    --on-cobalt: #eaf0fb;   /* text on cobalt                           */

    /* accent rotation for cards (three pigments) */
    --accent-1:  var(--cobalt);
    --accent-2:  var(--cinnabar);
    --accent-3:  var(--cadmium);

    /* type */
    --display: "Sora", system-ui, sans-serif;
    --body:    "Inter", system-ui, sans-serif;

    /* metrics */
    /* --maxw: 1200px; */
    --maxw: 1600px;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(11, 46, 111, .08);
    --shadow-lg: 0 24px 60px rgba(11, 46, 111, .14);
}

/* ----------------------------- reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); color: var(--cobalt); letter-spacing: -.02em; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--cadmium); color: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* shared eyebrow */
.eyebrow {
    font-family: var(--body); font-weight: 700; font-size: .72rem;
    letter-spacing: .16em; text-transform: uppercase; color: var(--cadmium);
    margin: 0 0 .85rem; display: flex; align-items: center; gap: .55rem;
}
.eyebrow::before {
    content: ""; width: 22px; height: 3px; background: var(--cadmium); border-radius: 2px;
}
.eyebrow--light { color: #ffb27d; }
.eyebrow--light::before { background: var(--cadmium); }

.section-title {
    font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0 0 1.6rem; line-height: 1.15;
}

/* ============================ TOP BAR ============================== */
.topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.topbar__inner {
    max-width: var(--maxw); margin: 0 auto; padding: .9rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .7rem; color: var(--cobalt); }
.brand:hover { text-decoration: none; }
.brand__mark {
    font-family: var(--display); font-weight: 800; font-size: 1rem;
    color: #fff; width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--cobalt) 0 50%, var(--cadmium) 50% 100%);
}
.brand__logo { height: 48px; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.18rem; color: var(--cobalt); letter-spacing: -.02em; }
.brand__tag { font-size: .7rem; letter-spacing: .04em; color: var(--slate); font-weight: 500; }

.topbar__meta { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.topbar__phone { font-weight: 600; font-size: .9rem; color: var(--cobalt); }
.topbar__phone:hover { color: var(--blue); text-decoration: none; }
.topbar__login {
    font-size: .8rem; font-weight: 600; color: var(--cobalt);
    padding: .5rem .9rem; border: 1.5px solid var(--line); border-radius: 999px;
}
.topbar__login:hover { text-decoration: none; border-color: var(--cobalt); }

/* mobile nav toggle */
.nav-toggle {
    display: none; align-items: center; gap: .5rem; margin-left: auto;
    background: var(--cobalt); color: #fff; border: 0;
    border-radius: 10px; padding: .55rem .85rem; cursor: pointer;
    font-family: var(--body); font-size: .8rem; font-weight: 600;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    content: ""; display: block; width: 18px; height: 2px; background: #fff; position: relative;
}
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after  { position: absolute; top: 6px; }

/* ============================== NAV =============================== */
.nav { background: var(--cobalt); }
.nav__list {
    max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
    list-style: none; display: flex; gap: .15rem;
}
.nav__cat { position: relative; }
.nav__catlink {
    display: inline-flex; align-items: center; gap: .45rem;
    font-family: var(--body); font-size: .92rem; font-weight: 600;
    color: var(--on-cobalt); background: none; border: 0; cursor: pointer;
    padding: 1.05rem .95rem;
}
.nav__catlink:hover { color: #fff; text-decoration: none; }
.nav__cat::after {
    content: ""; position: absolute; left: .95rem; right: .95rem; bottom: 0; height: 3px;
    background: var(--cadmium); border-radius: 3px 3px 0 0; transform: scaleX(0); transition: transform .2s;
}
.nav__cat:hover::after, .nav__cat.is-open::after { transform: scaleX(1); }
.nav__chev {
    width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; opacity: .8; transition: transform .2s;
}
.nav__cat.is-open .nav__chev { transform: rotate(180deg); }

.nav__cta {
    margin-left: auto; align-self: center;
    background: var(--cadmium); color: #fff; font-weight: 700; font-size: .9rem;
    padding: .6rem 1.2rem; border-radius: 999px; white-space: nowrap;
}
.nav__cta:hover { background: #d95f12; text-decoration: none; color: #fff; }

.nav__drop {
    list-style: none; margin: 0; padding: .5rem; min-width: 280px;
    position: absolute; top: 100%; left: 0; z-index: 40;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: .16s ease;
}
.nav__cat:hover .nav__drop,
.nav__cat.is-open .nav__drop { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__drop--left { left: auto; right: 0; } /* set by main.js near the right edge */
.nav__drop a {
    display: flex; align-items: center; gap: .6rem;
    color: var(--ink); font-size: .92rem; font-weight: 500; padding: .6rem .7rem; border-radius: 8px;
}
.nav__drop a:hover { background: var(--cloud); color: var(--cobalt); text-decoration: none; }
.nav__dot { width: 7px; height: 7px; background: var(--cadmium); border-radius: 50%; flex: none; }

/* current page: highlight its menu and sub menu item */
.nav__cat.is-current::after { transform: scaleX(1); }
.nav__cat.is-current > .nav__catlink { color: var(--cadmium); }
.nav__drop a.is-current { background: var(--cloud); color: var(--cadmium); font-weight: 700; }

/* ============================== HERO ============================== */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 140% at 100% 0%, #14409a 0%, transparent 55%),
        linear-gradient(160deg, var(--cobalt) 0%, var(--cobalt-d) 100%);
    color: var(--on-cobalt);
}
.hero::before { /* faint symmetry seam down the centre */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 80px);
    mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}
.hero__inner {
    max-width: var(--maxw); margin: 0 auto; padding: 4.5rem 1.5rem 4rem;
    display: grid; grid-template-columns: 1.25fr .75fr; gap: 2.5rem; align-items: center;
}
.hero__title {
    color: #fff; font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.04; margin: 0 0 1.25rem; max-width: 18ch;
}
.hero__body { font-size: 1.1rem; max-width: 58ch; color: #cdd9f0; }
.hero__body .lede { font-size: 1.22rem; color: #fff; margin-top: 0; }
.hero__actions { margin-top: 1.9rem; display: flex; flex-wrap: wrap; gap: .8rem; }

/* signature emblem: two halves meeting in symmetry */
.hero__emblem { display: grid; place-items: center; }
.hero__emblem svg { width: min(320px, 80%); height: auto; filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }
.emblem__left  { fill: var(--cadmium); }
.emblem__right { fill: #ffffff; opacity: .92; }
.emblem__core  { fill: var(--cinnabar); }
.emblem__edge  { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 2; }
.hero__logo { width: min(380px, 70vw); height: auto; }

/* ============================ BUTTONS ============================= */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--body); font-size: .95rem; font-weight: 700;
    background: var(--cobalt); color: #fff; border: 2px solid var(--cobalt);
    padding: .7rem 1.3rem; border-radius: 999px; cursor: pointer; transition: .15s;
}
.btn:hover { background: var(--cobalt-d); border-color: var(--cobalt-d); text-decoration: none; color: #fff; }
.btn--lg { padding: .85rem 1.6rem; font-size: 1rem; }
.btn--accent { background: var(--cadmium); border-color: var(--cadmium); }
.btn--accent:hover { background: #d95f12; border-color: #d95f12; }
.btn--onblue { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--onblue:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

/* ============================ LAYOUT ============================== */
.layout {
    max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 3.5rem;
    display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 3rem; align-items: start;
}

/* ============================== NEWS ============================== */
.news__grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem;
}
.card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem; position: relative; transition: .18s; box-shadow: var(--shadow);
    border-top: 4px solid var(--accent, var(--cobalt));
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__title { font-size: 1.12rem; font-weight: 600; margin: 0 0 .55rem; line-height: 1.25; }
.card__excerpt { margin: 0 0 1.1rem; color: var(--slate); font-size: .95rem; }
.card__link { font-weight: 700; font-size: .9rem; color: var(--blue); }
.card__link:hover { text-decoration: none; color: var(--cobalt); }

/* ============================ ARTICLE ============================= */
.article__head { border-bottom: 2px solid var(--line); padding-bottom: 1.4rem; margin-bottom: 2rem; }
.article__title { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.08; margin: 0; }
.article__body { font-size: 1.05rem; color: #25324a; }
.article__body h2 {
    font-size: 1.45rem; font-weight: 600; margin: 2.4rem 0 .9rem;
    padding-left: 1rem; border-left: 4px solid var(--cadmium);
}
.article__body p { margin: 0 0 1.15rem; max-width: 70ch; }
.article__body a { font-weight: 600; text-decoration: underline; }

/* editor content: long links wrap, wide tables scroll inside the column */
.article__body { overflow-wrap: anywhere; }
.article__body table { display: block; max-width: 100%; overflow-x: auto; overflow-wrap: normal; }
.article__body iframe, .article__body video { max-width: 100%; }

.article__body .team { display: grid; gap: 1.3rem; max-width: 70ch; margin: 0; }
.article__body .team dt { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--cobalt); }
.article__body .team dd { margin: .3rem 0 0; color: var(--slate); }

.article__body .partners { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.article__body .partners li { margin: 0; }
.article__body .partners a {
    font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--cobalt);
    border: 1.5px solid var(--line); padding: .55rem 1rem; border-radius: 999px; background: var(--paper);
}
.article__body .partners a:hover { border-color: var(--cadmium); color: var(--cadmium); }

/* ============================ SIDEBAR ============================= */
.sidebar { display: grid; gap: 1.2rem; position: sticky; top: 120px; }
.panel {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.panel__eyebrow {
    font-weight: 700; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--cadmium); margin: 0 0 .8rem;
}
.panel__title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--cobalt); margin: 0 0 .5rem; }
.panel__address { font-style: normal; font-size: .95rem; line-height: 1.75; color: #2b384f; }
.panel__address a { color: var(--blue); }
.panel__data { font-weight: 600; font-size: .98rem; margin: 0; color: var(--ink); }
.panel__muted { color: var(--slate); font-size: .82rem; }
.panel__hours { font-size: .95rem; margin: 0 0 .5rem; color: #2b384f; }

.panel--accent {
    background: linear-gradient(160deg, var(--cobalt), var(--cobalt-d));
    border: 0; color: var(--on-cobalt);
}
.panel--accent .panel__eyebrow { color: #ffb27d; }
.panel__cta-text { font-size: .95rem; color: #cdd9f0; margin: 0 0 1.2rem; }
.panel--accent .btn { background: var(--cadmium); border-color: var(--cadmium); }
.panel--accent .btn:hover { background: #d95f12; border-color: #d95f12; }

/* ============================ FOOTER ============================== */
.footer { background: var(--cobalt-d); color: #aebde0; }
.footer__inner {
    max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.5rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; font-size: .9rem;
}
.footer__brand { color: #fff; font-family: var(--display); font-weight: 600; }
.footer__copy { margin-left: auto; }
.footer__login { color: #aebde0; font-weight: 600; }
.footer__login:hover { color: #fff; }

/* contact form: keep its top clear of the sticky header when a button jumps to it */
#contact { scroll-margin-top: 8rem; }

/* ========================= RESPONSIVE ============================= */
/* desktop: menu items wrap onto a new row instead of running off the screen */
@media (min-width: 1101px) {
    .nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; padding: 0 1.5rem; overflow-x: clip; }
    .nav__list { display: contents; }
    .nav__catlink { white-space: nowrap; }
    .nav__cta { margin: .5rem 0 .5rem .75rem; }
}

/* tablets and phones: menu button */
@media (max-width: 1100px) {
    .nav-toggle { display: inline-flex; }
    .topbar__meta { display: none; }
    #contact { scroll-margin-top: 4.5rem; }

    .nav { display: none; }
    .nav.is-open { display: block; max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); overflow-y: auto; }
    .nav__list { flex-direction: column; padding: .5rem 1.5rem 1rem; gap: 0; }
    .nav__cat { border-bottom: 1px solid rgba(255,255,255,.12); }
    .nav__cat::after { display: none; }
    .nav__catlink { width: 100%; justify-content: space-between; padding: 1rem 0; }
    .nav__cta { margin: .4rem 1.5rem 1rem; align-self: stretch; text-align: center; justify-content: center; display: flex; }

    .nav__drop {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: 0; min-width: 0; padding: 0 0 .6rem .7rem;
        display: none; background: transparent;
    }
    .nav__cat.is-open .nav__drop { display: block; }
    .nav__drop a { color: #dbe4fb; }
    .nav__drop a:hover { background: rgba(255,255,255,.08); color: #fff; }
}

/* one column; minmax(0, ...) so wide content can't push the page wider than the screen */
@media (max-width: 940px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; }
    .hero__inner { grid-template-columns: minmax(0, 1fr); padding: 3rem 1.5rem; }
    .hero__emblem { order: -1; }
    .hero__emblem svg { width: 180px; }
}

@media (max-width: 560px) {
    .layout { padding: 2rem 1.1rem 2.5rem; }
    .news__grid { grid-template-columns: 1fr; }
    .footer__copy { margin-left: 0; width: 100%; }

    .topbar__inner { padding: .7rem 1.1rem; }
    .brand__logo { height: 36px; }
    .brand__name { white-space: nowrap; }

    /* contact form: labels above full-width fields; the Cloudflare check needs 300px */
    .hero__inner { padding: 2.5rem 1rem; }
    #contact .panel { padding: 1.25rem .85rem; }
    #contact td { display: block; text-align: left; }
    #contact td[colspan] { text-align: center; }
    #contact input[type="text"], #contact textarea { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto; }
}
