/*
Theme Name: IMFI Petroleum
Description: Bilingual commercial desk for IMFI Petroleum.
Version: 2.1.0
Text Domain: imfi
*/
:root {
    --paper: #f7f5ee;
    --white: #fffef8;
    --ink: #112c38;
    --navy: #12323e;
    --muted: #475c61;
    --ochre: #826529;
    --gold: #d5b574;
    --rule: #c9c7b7;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
    --gutter: clamp(1.15rem, 4.6vw, 5.2rem);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.65 var(--sans);
    -webkit-text-size-adjust: 100%;
}
html[lang="th"] {
    --sans: "Thonburi", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
    --serif: "Thonburi", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
}
a { color: inherit; text-underline-offset: .22em; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #05738e; outline-offset: 4px; }
::selection { color: var(--ink); background: #ead593; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(3.2rem, 5.5vw, 6rem); line-height: 1.03; letter-spacing: -.054em; }
h2 { font-size: clamp(2.25rem, 3.8vw, 4rem); line-height: 1.08; letter-spacing: -.044em; }
html[lang="th"] :is(h1, h2, h3) { line-height: 1.38; letter-spacing: -.027em; }
html[lang="th"] h1 { font-size: clamp(2.5rem, 4.4vw, 4.65rem); }
html[lang="th"] h2 { font-size: clamp(1.9rem, 3.1vw, 3rem); }
.wrap { width: min(100% - var(--gutter) * 2, 77rem); margin-inline: auto; }
.source-credit { color: var(--muted); font-size: .85rem; padding-block: 1.3rem; border-top: 1px solid var(--rule); }
.flow > * + * { margin-block-start: 1em; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 10; transform: translateY(-160%); background: var(--white); padding: .6rem 1rem; }
.skip:focus { transform: none; }
.masthead { background: var(--paper); border-block-end: 1px solid var(--rule); }
.mast-inner, .primary-menu, .mast-actions, .nav-list { display: flex; align-items: center; }
.mast-inner { gap: 2rem; min-height: 5.45rem; }
.wordmark { display: inline-flex; flex-direction: column; flex: 0 0 auto; align-items: flex-start; color: var(--ink); text-decoration: none; }
.wordmark-main { font: 800 2.34rem/.93 Georgia, serif; letter-spacing: -.09em; padding-right: .1em; }
.wordmark-small { margin: .3rem 0 0 .15rem; font: 700 .49rem/1.1 Arial, sans-serif; letter-spacing: .24em; text-transform: uppercase; }
.site-logo { max-height: 3.3rem; max-width: 9.5rem; width: auto; object-fit: contain; }
.primary-menu { justify-content: flex-end; flex: 1; gap: clamp(1.2rem, 3.8vw, 3.8rem); }
.nav-list, .service-list, .catalogue-group ul { list-style: none; padding: 0; margin: 0; }
.nav-list { gap: clamp(.75rem, 2vw, 2rem); flex-wrap: wrap; }
.nav-list a, .language-link, .site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .89rem; font-weight: 550; text-decoration: none; }
.nav-list a:hover, .nav-list [aria-current], .language-link:hover, .site-footer nav a:hover, .site-footer nav [aria-current] { text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: .4em; }
.mast-actions { gap: 1.15rem; flex-shrink: 0; }
.language-link { border-inline-start: 1px solid var(--rule); padding-inline-start: 1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 1.3rem; min-height: 3rem; padding: .7rem 1.1rem; font-size: .9rem; font-weight: 650; line-height: 1.45; text-decoration: none; border: 1px solid transparent; }
.button::after, .text-link::after, .line-arrow, .small-arrow { content: ""; display: inline-block; width: .85rem; height: .66rem; flex-shrink: 0; background: currentColor; clip-path: polygon(0 42%,74% 42%,49% 11%,59% 0,100% 50%,59% 100%,49% 88%,74% 57%,0 57%); transition: transform .18s ease; }
.button:hover::after, .text-link:hover::after, .service-link:hover .line-arrow, .product-inquire:hover .small-arrow { transform: translateX(.2rem); }
.button-dark, .imfi-inquiry button, .imfi-product-inquire { background: var(--navy); color: var(--white); }
.button-dark:hover, .imfi-inquiry button:hover, .imfi-product-inquire:hover { background: #214b57; }
.imfi-product-inquire { display: inline-flex; align-items: center; min-height: 46px; padding: .65rem 1.1rem; font: 600 .95rem/1.5 var(--sans); text-decoration: none; }
.button-light { background: var(--paper); color: var(--ink); }
.button-light:hover { background: #f0e4c4; }
.nav-cta { min-height: 2.75rem; font-size: .85rem; }
.nav-toggle { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; border: 0; background: none; color: var(--ink); font-weight: 650; cursor: pointer; }
.menu-glyph { display: inline-block; width: 1.2rem; height: .6rem; border-block: 2px solid currentColor; }
.text-link { display: inline-flex; align-items: center; gap: .65rem; width: fit-content; min-height: 44px; font-size: .93rem; font-weight: 650; text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: .35em; }
.hero { padding-block: clamp(3.35rem, 6.4vw, 6.9rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); gap: clamp(2rem, 5.3vw, 5.6rem); align-items: center; }
.hero-copy h1 { max-width: 12.6em; text-wrap: balance; }
.hero-lead { max-width: 34rem; margin-top: 1.55rem; color: var(--muted); font-size: clamp(1.035rem, 1.35vw, 1.22rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem 1.55rem; align-items: center; margin-top: 1.85rem; }
.coordination {
    --plate-pad: clamp(1.35rem, 2.6vw, 2.6rem);
    position: relative;
    isolation: isolate;
    padding: var(--plate-pad);
    color: #fffdf2;
    background-color: #133440;
    background-image: radial-gradient(circle, rgba(220,224,203,.18) .7px, transparent .9px);
    background-size: 13px 13px;
    outline: 1px solid rgba(245,235,201,.23);
    outline-offset: -.58rem;
}
.coordination::before, .coordination::after {
    content: ""; position: absolute; pointer-events: none; height: .7rem; width: .7rem; border-color: var(--gold); border-style: solid;
}
.coordination::before { top: .55rem; left: .55rem; border-width: 1px 0 0 1px; }
.coordination::after { right: .55rem; bottom: .55rem; border-width: 0 1px 1px 0; }
.coordination h2, html[lang="th"] .coordination h2 { font-family: var(--sans); font-size: .84rem; font-weight: 650; letter-spacing: .02em; line-height: 1.5; }
.coordination :focus-visible, .contact-stripe :focus-visible { outline-color: #f3d17c; }
.role-track { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; margin: clamp(1.75rem, 3.6vw, 3.25rem) 0 clamp(1.6rem, 3vw, 2.75rem); }
.role-track::before {
    content: ""; position: absolute; top: 1.5rem; inset-inline: 16.7%; height: 1px;
    background: repeating-linear-gradient(to right, #acb5a3 0 6px, transparent 6px 10px);
}
.role-switch { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: start; min-height: 44px; padding: 0 .1rem; gap: .72rem; color: #f0f0de; text-decoration: none; }
.role-node { position: relative; display: grid; place-items: center; width: 3rem; height: 3rem; background: #173a45; border: 1px solid #889e9e; border-radius: 50%; transition: background-color .2s, border-color .2s; }
.role-node i { position: relative; display: block; width: .8rem; height: .8rem; border: 1px solid #dfd8b8; }
.role-buyer .role-node i { border-radius: 50%; }
.role-imfi .role-node i { transform: rotate(45deg); }
.role-imfi .role-node::before { content: ""; position: absolute; inset: -.4rem; border: 1px solid #9c9f84; border-radius: 50%; }
.role-name { font-size: .82rem; font-weight: 600; }
.role-switch:hover .role-node, .role-switch[aria-selected="true"] .role-node { border-color: var(--gold); background: #244652; }
.role-switch[aria-selected="true"] .role-node i { border-color: var(--gold); background: var(--gold); }
.role-switch[aria-selected="true"] .role-name { color: #f0d494; text-decoration: underline; text-underline-offset: .27rem; }
.role-notes { border-top: 1px solid #667c77; padding-top: 1.25rem; }
.role-panel + .role-panel { margin-top: 1rem; }
.interactive .role-notes { display: grid; align-content: start; }
.interactive .role-panel { grid-area: 1 / 1; align-self: start; margin: 0; }
.interactive .role-panel[inert] { visibility: hidden; }
.interactive .role-panel[inert] .role-prep > :not(summary) { display: none; }
.role-panel h3 { font: 400 clamp(1.55rem, 2.3vw, 2.2rem)/1.18 var(--serif); letter-spacing: -.03em; }
.role-panel p { margin-top: .5rem; color: #e1e7dc; font-size: .93rem; line-height: 1.65; }
.role-prep { margin-top: .3rem; font-size: .89rem; }
.role-prep summary { display: list-item; width: fit-content; max-width: 100%; min-height: 44px; padding-block: .65rem; cursor: pointer; font-weight: 600; }
.role-prep summary::marker { color: #e9cb86; }
.role-prep ul { padding-inline-start: 1.2em; margin: .1rem 0 .6rem; color: #e1e7dc; list-style: disc; }
.role-prep li + li { margin-top: .35rem; }
.role-panel .text-link { color: #f4d690; margin-top: .2rem; }
html[lang="th"] .role-panel h3 { font-size: clamp(1.25rem, 2vw, 1.7rem); }
.ruled-section { padding-block: clamp(3.15rem, 6.3vw, 6.2rem); border-block-start: 1px solid var(--rule); }
.section-split, .review-grid { display: grid; grid-template-columns: minmax(0, .74fr) minmax(0, 1.22fr); gap: clamp(2rem, 6.8vw, 7rem); align-items: start; }
.section-intro h2, .review-grid h2 { max-width: 12em; text-wrap: balance; }
.section-intro p { margin-top: 1.05rem; max-width: 31rem; color: var(--muted); font-size: 1.035rem; line-height: 1.7; }
.section-intro .text-link, .review-grid .text-link { margin-top: .8rem; }
.service-list { border-top: 1px solid var(--ink); }
.service-list li { border-bottom: 1px solid var(--rule); }
.service-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.2rem; padding-block: .85rem; text-decoration: none; font-family: var(--serif); font-size: clamp(1.4rem, 2.1vw, 2rem); line-height: 1.3; letter-spacing: -.028em; }
html[lang="th"] .service-link { font-size: clamp(1.17rem, 1.65vw, 1.52rem); line-height: 1.5; }
.service-link:hover span:first-child, .service-link:focus-visible span:first-child { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--ochre); text-underline-offset: .19em; }
.service-link .line-arrow { color: var(--ochre); width: 1.1rem; height: .9rem; }
.service-list li p { color: var(--muted); font-size: 1rem; max-width: 39rem; margin: -.3rem 1.4rem 1.4rem 0; }
.catalogue-section { background: #ecece1; }
.catalogue-list { border-top: 1px solid var(--ink); }
.catalogue-group { border-bottom: 1px solid #a7ac9d; }
.catalogue-group summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.4rem; padding-block: .95rem; font-weight: 570; font-size: clamp(1.03rem, 1.55vw, 1.35rem); cursor: pointer; list-style: none; }
.catalogue-group summary::-webkit-details-marker { display: none; }
.catalogue-group summary:hover { color: #63501d; }
.expand-sign { position: relative; width: 1rem; height: 1rem; flex-shrink: 0; }
.expand-sign::before, .expand-sign::after { content: ""; position: absolute; inset: calc(50% - 1px) 0 auto; height: 2px; background: var(--ochre); }
.expand-sign::after { transform: rotate(90deg); transition: transform .18s ease; }
details[open] > summary .expand-sign::after { transform: rotate(0deg); }
.catalogue-group ul { margin: 0 0 1.2rem; padding-inline-start: clamp(.75rem, 1.7vw, 1.45rem); border-inline-start: 2px solid #c1aa74; }
.catalogue-group li { display: flex; gap: .8rem; align-items: center; justify-content: space-between; }
.catalogue-group li + li { border-top: 1px solid #c9cdbd; }
.product-name, .product-inquire { display: inline-flex; align-items: center; min-height: 44px; padding-block: .35rem; }
.product-name { font-weight: 550; text-decoration-thickness: 1px; text-decoration-color: #9c9f8c; }
.product-inquire { flex-shrink: 0; gap: .4rem; color: #56471d; text-decoration: none; font-size: .86rem; }
.product-inquire:hover { text-decoration: underline; }
.small-arrow { width: .7rem; height: .54rem; }
.review-section { padding-block: clamp(3.3rem, 6.2vw, 6rem); border-block-start: 1px solid var(--rule); }
.review-copy { border-inline-start: 2px solid var(--ochre); padding-inline-start: clamp(1.2rem, 2.9vw, 2.8rem); }
.review-copy p { font-family: var(--serif); font-size: clamp(1.45rem, 2.4vw, 2.35rem); line-height: 1.3; letter-spacing: -.02em; }
html[lang="th"] .review-copy p { font-size: clamp(1.2rem, 1.8vw, 1.55rem); line-height: 1.65; }
.contact-stripe { padding-block: clamp(2.8rem, 4.6vw, 4.8rem); color: var(--white); background: var(--navy); border-top: .25rem solid var(--gold); }
.contact-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem 3rem; }
.contact-inner h2 { max-width: 16em; }
.contact-inner .button { flex-shrink: 0; }
.site-footer { padding-block: 1.5rem; border-top: 1px solid var(--rule); }
.footer-brand { font: 600 1.35rem/1.3 Georgia, serif; letter-spacing: -.04em; text-decoration: none; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.page-intro { padding-block: clamp(2.3rem, 4.7vw, 4.75rem); background: #eeeede; border-bottom: 1px solid var(--rule); }
.page-intro h1 { max-width: 16em; }
.back-link { display: inline-flex; gap: .55rem; align-items: center; min-height: 44px; margin-bottom: .6rem; font-size: .86rem; color: var(--muted); }
.back-link::before { content: "←"; text-decoration: none; }
.page-content, .process-plate, .archive { padding-block: clamp(2.2rem, 4.1vw, 4.25rem); }
.process-plate { padding-block-start: 0; }
.process-plate .coordination { max-width: 46rem; }
.reading { max-width: 48rem; font-size: clamp(1.05rem, 1.38vw, 1.21rem); }
.reading > p:first-child { color: #344e55; }
.reading h2, .archive h2 { font-size: clamp(1.6rem, 2.5vw, 2.5rem); }
html[lang="th"] .reading h2 { font-size: clamp(1.45rem, 2.15vw, 2rem); }
.reading :is(h2, h3):not(:first-child) { margin-top: 1.4em; }
.reading h2 + p { margin-top: .55em; }
.reading ul, .reading ol { padding-inline-start: 1.5em; }
.article-photo { display: block; margin-bottom: 2rem; }
.page-content > .button { margin-top: 1.4rem; }
.archive { min-height: 55vh; }
.archive article { margin-top: 2rem; }
.imfi-inquiry { margin-top: 2.1rem; padding: clamp(1.2rem, 3vw, 2.65rem); background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--ochre); font-size: 1rem; }
.imfi-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; }
.imfi-inquiry label { display: block; margin-top: .9rem; color: var(--ink); font-weight: 600; }
.imfi-inquiry :is(input:not([type="hidden"]), select, textarea) { display: block; width: 100%; min-height: 44px; margin-top: .35rem; padding: .65rem .75rem; border: 1px solid #7a8986; border-radius: 0; background: #fff; color: var(--ink); font-weight: 400; }
.imfi-inquiry textarea { resize: vertical; min-height: 8rem; }
.imfi-product textarea { min-height: 5rem; }
.imfi-inquiry :is(input, select, textarea)[aria-invalid="true"] { border: 2px solid #a03223; }
.imfi-inquiry button { display: inline-block; min-height: 46px; margin-top: 1rem; padding: .68rem 1.3rem; border: 1px solid var(--navy); cursor: pointer; font-weight: 600; }
.imfi-field-error, .imfi-form-errors { color: #852c21; }
.imfi-field-error, .imfi-form-privacy { font-size: .91rem; }
.imfi-form-privacy { margin-top: 1rem; color: var(--muted); }
.imfi-form-errors, .imfi-form-receipt { margin-block: 1rem; padding: 1rem 1.2rem; background: var(--white); border: 1px solid var(--rule); border-inline-start: 3px solid #a03223; }
.imfi-form-receipt { border-inline-start-color: #306551; }
@media (min-width: 61rem) {
    .hero-grid .interactive .role-notes { min-height: 8.5rem; }
}
@media (max-width: 60rem) {
    .language-link { margin-inline-start: auto; border: 0; padding-inline: .3rem; min-width: 44px; justify-content: center; }
    .nav-toggle { margin-inline-start: 0; }
    .mast-inner { flex-wrap: wrap; row-gap: 0; min-height: 4.6rem; padding-block: .65rem; }
    .primary-menu { flex: 1 0 100%; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1.5rem; padding-block: .6rem; }
    .nav-list { gap: .15rem 1.3rem; }
    .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 2rem; }
    .hero-copy h1 { font-size: clamp(2.9rem, 6.3vw, 4.3rem); }
    html[lang="th"] .hero-copy h1 { font-size: clamp(2.32rem, 5.3vw, 3.5rem); }
}
@media (max-width: 47rem) {
    .hero-grid, .section-split, .review-grid { grid-template-columns: minmax(0, 1fr); gap: 2.1rem; }
    .hero-copy h1 { font-size: clamp(3.05rem, 9vw, 4.5rem); }
    html[lang="th"] .hero-copy h1 { font-size: clamp(2.4rem, 7.4vw, 3.65rem); }
    .hero-lead, .section-intro p { max-width: 37rem; }
    .hero-actions { margin-top: 1.4rem; }
    .contact-inner, .footer-inner { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
    .footer-inner { gap: .35rem; }
}
@media (max-width: 38rem) {
    .mast-inner { column-gap: .7rem; }
    .primary-menu { flex-direction: column; padding-block: .8rem .4rem; }
    .nav-list { flex-wrap: wrap; gap: .15rem 1.1rem; }
    .language-link { padding-inline-start: 0; border: 0; }
    .coordination { --plate-pad: 1.35rem; }
    .coordination h2 { margin-bottom: 1.4rem; }
    .coordination.interactive { display: grid; grid-template-columns: minmax(4.6rem, .46fr) minmax(0, 1fr); gap: 0 .9rem; }
    .coordination.interactive h2 { grid-column: 1 / -1; }
    .role-track { grid-template-columns: 1fr; align-self: start; gap: .72rem; margin: 0; }
    .role-track::before { inset: 1.15rem auto 1.15rem 1.1rem; width: 1px; height: auto; background: repeating-linear-gradient(to bottom, #acb5a3 0 5px, transparent 5px 9px); }
    .role-switch { flex-direction: row; align-items: center; gap: .4rem; justify-content: flex-start; padding-inline: 0; }
    .role-node { width: 2.2rem; height: 2.2rem; flex-shrink: 0; }
    .role-imfi .role-node::before { inset: -.2rem; }
    .role-node i { width: .62rem; height: .62rem; }
    .role-name { font-size: .74rem; }
    .role-notes { margin-top: 1.15rem; }
    .interactive .role-notes { border: 0; border-inline-start: 1px solid #667c77; margin: 0; padding: .1rem 0 .1rem .9rem; }
    .role-panel h3 { font-size: 1.48rem; }
    .role-panel p { font-size: .89rem; }
    .imfi-form-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 21.5rem) {
    .coordination.interactive { grid-template-columns: minmax(0, 1fr); }
    .interactive .role-notes { border-inline: 0; border-top: 1px solid #667c77; padding: .9rem 0 0; margin-top: 1rem; }
    .primary-menu .mast-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
