/*
Theme Name:   Newsmatic FNFM
Theme URI:    https://fnf.md/
Description:  Child theme of Newsmatic for the Federația Națională a Fermierilor din Moldova. Editorial front page, dropdown menu, left-sidebar pages, three switchable color schemes.
Author:       FNFM
Template:     newsmatic
Version:      1.0.1
Text Domain:  fnfm
*/

/* =========================================================
   1. COLOR SCHEMES  (Appearance → Customize → FNFM → Schemă de culori)
   Change a value here and the whole site follows.
   ========================================================= */
body.fnfm-scheme-camp {
  --paper:#F6F1E6; --paper-2:#FBF8F0; --ink:#17241B; --muted:#55645A;
  --primary:#2D5A3D; --primary-dark:#1E3D2A; --accent:#E0A93B; --accent-ink:#17241B;
  --line:#D8D0BD; --on-dark:#E7EFE4; --on-dark-muted:#B7C4B9; --tint:#EDF3EA;
  --font-display:'Source Serif 4',Georgia,serif; --font-body:'Inter',system-ui,sans-serif;
}
body.fnfm-scheme-pamant {
  --paper:#F7F0E6; --paper-2:#FCF8F1; --ink:#231A14; --muted:#66554A;
  --primary:#9C4A26; --primary-dark:#3A2216; --accent:#D8B24A; --accent-ink:#231A14;
  --line:#DBCDB7; --on-dark:#F0E4D4; --on-dark-muted:#CDBBA6; --tint:#F3E6D8;
  --font-display:'Fraunces',Georgia,serif; --font-body:'Public Sans',system-ui,sans-serif;
}
body.fnfm-scheme-cer {
  --paper:#F5F8FB; --paper-2:#FFFFFF; --ink:#0F1E2E; --muted:#4A5B6C;
  --primary:#1D4E89; --primary-dark:#0F2A4A; --accent:#F2B705; --accent-ink:#0F1E2E;
  --line:#D3DDE8; --on-dark:#E3ECF6; --on-dark-muted:#A9BBD0; --tint:#E6EEF8;
  --font-display:'Lora',Georgia,serif; --font-body:'Source Sans 3',system-ui,sans-serif;
}

/* =========================================================
   2. BASE
   ========================================================= */
body.fnfm { margin:0; background:var(--paper); color:var(--ink); font-family:var(--font-body); line-height:1.55; }
body.fnfm * { box-sizing:border-box; }
body.fnfm a { color:inherit; text-decoration:none; }
body.fnfm a:hover { text-decoration:underline; }
body.fnfm img { max-width:100%; height:auto; }
body.fnfm ul { list-style:none; margin:0; padding:0; }
.fnfm-wrap { max-width:1240px; margin:0 auto; padding:0 24px; width:100%; }
.screen-reader-text { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.screen-reader-text:focus { left:8px; top:8px; width:auto; height:auto; padding:10px 14px; background:#fff; color:#000; z-index:100000; }
.fnfm-display, body.fnfm h1, body.fnfm h2, body.fnfm h3 { font-family:var(--font-display); }
.fnfm-eyebrow { font-size:12px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--primary); }
.fnfm-btn { display:inline-block; background:var(--primary); color:#fff !important; font-weight:600; padding:12px 22px; border-radius:4px; border:0; cursor:pointer; font-family:var(--font-body); font-size:15px; }
.fnfm-btn:hover { text-decoration:none !important; filter:brightness(1.08); }
.fnfm-btn--accent { background:var(--accent); color:var(--accent-ink) !important; }
.fnfm-section-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:8px; border-bottom:2px solid var(--ink); padding-bottom:12px; margin-bottom:28px; }
.fnfm-section-head h2 { margin:0; font-size:32px; font-weight:700; }
.fnfm-section-head a { font-weight:600; font-size:15px; text-decoration:underline; }
.fnfm-ph { background:repeating-linear-gradient(135deg,#DDD6C3 0 14px,#E8E2D1 14px 28px); }
.fnfm-furrow { height:12px; background:repeating-linear-gradient(90deg,var(--primary) 0 2px,transparent 2px 12px); opacity:.35; }

/* =========================================================
   3. HEADER + NAVIGATION
   ========================================================= */
.fnfm-topbar { background:var(--primary-dark); color:var(--on-dark); font-size:13px; }
.fnfm-topbar .fnfm-wrap { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 24px; padding-top:10px; padding-bottom:10px; }
.fnfm-topbar ul { display:flex; flex-wrap:wrap; gap:6px 20px; }
.fnfm-brandrow { display:flex; flex-wrap:wrap; gap:16px 28px; align-items:center; justify-content:space-between; padding-top:26px; padding-bottom:20px; }
.fnfm-brand { display:flex; flex-wrap:wrap; gap:18px; align-items:center; }
.fnfm-logo { width:84px; height:84px; border-radius:50%; border:3px solid var(--accent); background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; }
.fnfm-logo img, .fnfm-logo .custom-logo { width:100%; height:100%; object-fit:cover; display:block; }
.fnfm-site-title { margin:0; font-family:var(--font-display); font-weight:700; font-size:34px; line-height:1.1; letter-spacing:-0.01em; }
.fnfm-site-desc { margin:6px 0 0; font-family:var(--font-display); font-style:italic; font-size:19px; color:var(--muted); }
.fnfm-search { display:flex; gap:8px; align-items:center; }
.fnfm-search input[type=search] { font:400 15px var(--font-body); padding:11px 14px; border:1px solid var(--line); background:#fff; border-radius:4px; min-width:200px; color:var(--ink); }
.fnfm-search button { width:44px; height:44px; border:0; border-radius:4px; background:var(--ink); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; }

.fnfm-nav { border-top:3px solid var(--ink); border-bottom:1px solid var(--line); background:var(--paper-2); }
.fnfm-nav .menu { display:flex; flex-wrap:wrap; gap:0 34px; align-items:center; font-weight:600; font-size:15px; }
.fnfm-nav .menu > li { position:relative; }
.fnfm-nav .menu > li > a { display:flex; align-items:center; gap:6px; padding:14px 0; }
.fnfm-nav .menu > li > a:hover { text-decoration:none; color:var(--primary); }
.fnfm-nav .menu-item-has-children > a::after { content:""; width:6px; height:6px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg) translateY(-2px); }
.fnfm-nav .current-menu-item > a, .fnfm-nav .current-menu-ancestor > a, .fnfm-nav .current-page-ancestor > a { color:var(--primary); box-shadow:inset 0 -3px 0 var(--accent); }
.fnfm-nav .sub-menu { display:none; position:absolute; left:0; top:100%; min-width:250px; background:#fff; border:1px solid var(--line); border-top:3px solid var(--primary); box-shadow:0 14px 28px rgba(0,0,0,.14); z-index:50; }
.fnfm-nav .menu-item-has-children:hover > .sub-menu,
.fnfm-nav .menu-item-has-children:focus-within > .sub-menu { display:block; }
.fnfm-nav .sub-menu a { display:block; padding:12px 18px; font-weight:500; font-size:15px; border-bottom:1px solid var(--line); }
.fnfm-nav .sub-menu a:hover { background:var(--paper); color:var(--primary); text-decoration:none; }
.fnfm-nav .fnfm-cta { margin-left:auto; }
.fnfm-nav .menu > li.fnfm-cta > a { background:var(--primary); color:#fff; padding:11px 22px; border-radius:4px; box-shadow:none; }
.fnfm-nav-toggle, .fnfm-sub-toggle { display:none; }
/* Newsmatic adds its own "+" submenu link to menu items; we use our own toggle on phones. */
.fnfm-nav .toggle-sub-menu { display:none !important; }
.fnfm-search button svg { width:20px; height:20px; flex:none; }

.fnfm-ticker { background:var(--accent); color:var(--accent-ink); font-size:14px; }
.fnfm-ticker .fnfm-wrap { display:flex; flex-wrap:wrap; gap:6px 16px; align-items:center; padding-top:12px; padding-bottom:12px; }
.fnfm-ticker strong { letter-spacing:.08em; font-size:12px; text-transform:uppercase; }
.fnfm-ticker span { flex:1 1 320px; }
.fnfm-ticker a { font-weight:600; text-decoration:underline; }

/* =========================================================
   4. FRONT PAGE
   ========================================================= */
.fnfm-lead { display:flex; flex-wrap:wrap; gap:40px; padding-top:44px; padding-bottom:28px; }
.fnfm-lead__main { flex:2 1 600px; min-width:0; }
.fnfm-lead__thumb { height:430px; border-bottom:4px solid var(--primary); overflow:hidden; }
.fnfm-lead__thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.fnfm-meta { display:flex; gap:12px; align-items:center; margin-top:18px; font-size:13px; color:var(--muted); }
.fnfm-lead__title { margin:10px 0 12px; font-size:42px; line-height:1.1; font-weight:700; letter-spacing:-0.01em; }
.fnfm-lead__excerpt { margin:0; font-size:18px; color:var(--muted); max-width:640px; }
.fnfm-lead__side { flex:1 1 320px; min-width:0; }
.fnfm-side-head { border-bottom:2px solid var(--ink); padding-bottom:10px; font-weight:600; font-size:12px; letter-spacing:.1em; color:var(--primary); }
.fnfm-side-item { display:flex; gap:16px; padding:18px 0; border-bottom:1px solid var(--line); }
.fnfm-side-item__thumb { width:112px; height:84px; flex-shrink:0; overflow:hidden; }
.fnfm-side-item__thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.fnfm-side-item h3 { margin:4px 0 0; font-size:19px; line-height:1.25; font-weight:700; }
.fnfm-cat { font-size:12px; letter-spacing:.08em; font-weight:600; color:var(--primary); text-transform:uppercase; }

.fnfm-services { padding-top:52px; padding-bottom:20px; }
.fnfm-services__grid { display:flex; flex-wrap:wrap; gap:20px; }
.fnfm-service { flex:1 1 340px; min-width:0; background:var(--paper-2); border:1px solid var(--line); border-radius:6px; padding:26px; display:flex; gap:18px; align-items:flex-start; }
.fnfm-service:hover { border-color:var(--primary); text-decoration:none !important; }
.fnfm-service__icon { width:52px; height:52px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.fnfm-service__title { display:block; font-family:var(--font-display); font-weight:700; font-size:22px; line-height:1.2; }
.fnfm-service__more { display:block; margin-top:8px; font-size:14px; font-weight:600; color:var(--primary); }

.fnfm-campaign { background:var(--primary-dark); background-image:repeating-linear-gradient(115deg,rgba(255,255,255,.035) 0 2px,transparent 2px 22px); color:var(--on-dark); margin-top:40px; }
.fnfm-campaign .fnfm-wrap { padding-top:56px; padding-bottom:56px; display:flex; flex-wrap:wrap; gap:36px 56px; align-items:center; }
.fnfm-campaign__text { flex:1 1 380px; }
.fnfm-campaign .fnfm-eyebrow { color:var(--accent); }
.fnfm-campaign h2 { margin:10px 0 14px; font-size:38px; line-height:1.12; font-weight:700; color:#fff; }
.fnfm-campaign p { margin:0 0 24px; font-size:17px; color:var(--on-dark-muted); max-width:520px; }
.fnfm-campaign__img { flex:1 1 380px; height:280px; overflow:hidden; border-radius:4px; }
.fnfm-campaign__img img { width:100%; height:100%; object-fit:cover; display:block; }

.fnfm-news { padding-top:60px; padding-bottom:24px; }
.fnfm-news__grid { display:flex; flex-wrap:wrap; gap:40px 28px; }
.fnfm-card { flex:1 1 340px; min-width:0; }
.fnfm-card__thumb { height:200px; overflow:hidden; }
.fnfm-card__thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.fnfm-card .fnfm-cat { display:block; margin-top:14px; }
.fnfm-card h3 { margin:6px 0 8px; font-size:22px; line-height:1.2; font-weight:700; }
.fnfm-card p { margin:0; font-size:15px; color:var(--muted); }

.fnfm-partners { padding-top:48px; padding-bottom:8px; }
.fnfm-partners .widget { margin:0; }
.fnfm-partners .wp-block-gallery, .fnfm-partners .gallery { display:flex; flex-wrap:wrap; gap:16px; }
.fnfm-partners img { max-height:72px; width:auto; filter:grayscale(1); opacity:.85; }
.fnfm-partners img:hover { filter:none; opacity:1; }

.fnfm-bottom { display:flex; flex-wrap:wrap; gap:40px; padding-top:48px; padding-bottom:64px; }
.fnfm-bottom__cats { flex:1 1 440px; }
.fnfm-bottom h3 { margin:0 0 16px; font-size:24px; font-weight:700; }
.fnfm-chips { display:flex; flex-wrap:wrap; gap:10px; }
.fnfm-chips a { border:1px solid var(--line); border-radius:999px; padding:9px 16px; font-size:15px; background:#fff; }
.fnfm-bottom__news { flex:1 1 380px; background:#fff; border:1px solid var(--line); padding:28px; border-radius:6px; }

/* =========================================================
   5. INNER PAGE WITH LEFT SIDEBAR
   ========================================================= */
.fnfm-pagehead { background:var(--paper-2); border-bottom:1px solid var(--line); }
.fnfm-pagehead .fnfm-wrap { padding-top:34px; padding-bottom:28px; }
.fnfm-crumbs { font-size:13px; color:var(--muted); margin-bottom:10px; }
.fnfm-crumbs a { text-decoration:underline; }
.fnfm-pagehead h1 { margin:0; font-size:46px; line-height:1.08; font-weight:700; letter-spacing:-0.01em; }
.fnfm-layout { display:flex; flex-wrap:wrap; gap:40px; padding-top:44px; padding-bottom:72px; }
.fnfm-sidebar { flex:1 1 260px; max-width:320px; min-width:240px; }
.fnfm-main { flex:3 1 560px; min-width:0; }
.fnfm-box { background:#fff; border:1px solid var(--line); border-top:3px solid var(--primary); border-radius:4px; margin-bottom:24px; }
.fnfm-box h2, .fnfm-box .widget-title { margin:0; padding:16px; font-size:19px; font-weight:700; border-bottom:1px solid var(--line); }
.fnfm-box li a { display:block; padding:13px 16px; border-bottom:1px solid var(--line); font-weight:500; font-size:15px; }
.fnfm-box li:last-child a { border-bottom:0; }
.fnfm-box li a:hover { background:var(--paper); text-decoration:none; }
.fnfm-box li.is-current a { background:var(--tint); color:var(--primary); font-weight:600; box-shadow:inset 4px 0 0 var(--accent); }
.fnfm-join { background:var(--primary); color:#fff; border-radius:4px; padding:22px; margin-bottom:24px; }
.fnfm-join strong { display:block; font-family:var(--font-display); font-size:21px; line-height:1.2; margin-bottom:10px; }
.fnfm-article__thumb { border-bottom:4px solid var(--primary); margin-bottom:28px; }
.fnfm-article__thumb img { display:block; width:100%; }
.fnfm-content { font-size:18px; line-height:1.7; max-width:760px; }
.fnfm-content h2 { font-size:30px; line-height:1.15; margin:36px 0 14px; }
.fnfm-content h3 { font-size:24px; margin:28px 0 12px; }
.fnfm-content ul { list-style:disc; padding-left:22px; margin:0 0 20px; }
.fnfm-content ol { padding-left:22px; margin:0 0 20px; }
.fnfm-content blockquote { margin:28px 0; padding:6px 0 6px 22px; border-left:4px solid var(--accent); font-family:var(--font-display); font-style:italic; font-size:22px; }
.fnfm-content a { color:var(--primary); text-decoration:underline; }
.fnfm-content table { width:100%; border-collapse:collapse; display:block; overflow-x:auto; }
.fnfm-content th, .fnfm-content td { border:1px solid var(--line); padding:8px 12px; }

/* =========================================================
   6. FOOTER
   ========================================================= */
.fnfm-footer { background:var(--ink); color:var(--on-dark); }
.fnfm-footer .fnfm-wrap { display:flex; flex-wrap:wrap; gap:32px 48px; padding-top:44px; padding-bottom:20px; font-size:15px; }
.fnfm-footer__brand { flex:1.4 1 260px; }
.fnfm-footer__brand strong { display:block; font-family:var(--font-display); font-size:20px; line-height:1.25; max-width:300px; }
.fnfm-footer__brand em { display:block; margin-top:8px; color:var(--on-dark-muted); font-family:var(--font-display); }
.fnfm-footer__col { flex:1 1 170px; color:var(--on-dark-muted); }
.fnfm-footer__col .widget-title { font-weight:600; color:#fff; margin:0 0 10px; font-size:15px; font-family:var(--font-body); }
.fnfm-footer__col li { margin-bottom:8px; }
.fnfm-footer__legal { border-top:1px solid rgba(255,255,255,.15); font-size:13px; color:var(--on-dark-muted); padding-top:18px !important; padding-bottom:32px !important; display:block !important; }

/* =========================================================
   7. MOBILE
   ========================================================= */
@media (max-width: 900px) {
  .fnfm-site-title { font-size:22px; }
  .fnfm-site-desc { font-size:15px; }
  .fnfm-logo { width:56px; height:56px; }
  .fnfm-brandrow { padding-top:16px; padding-bottom:14px; flex-wrap:nowrap; }
  .fnfm-search { display:none; }
  .fnfm-nav-toggle { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border:0; border-radius:4px; background:var(--ink); color:#fff; cursor:pointer; margin-left:auto; }
  .fnfm-nav { border-top:0; display:none; }
  .fnfm-nav.is-open { display:block; }
  .fnfm-nav .menu { flex-direction:column; align-items:stretch; gap:0; }
  .fnfm-nav .menu > li > a { padding:14px 4px; border-bottom:1px solid var(--line); }
  .fnfm-nav .menu-item-has-children > a::after { display:none; }
  .fnfm-nav .menu-item-has-children { display:grid; grid-template-columns:1fr 48px; }
  .fnfm-nav .menu-item-has-children > .sub-menu { grid-column:1 / -1; }
  .fnfm-nav .menu-item-has-children:hover > .sub-menu { display:none; }
  .fnfm-nav .menu-item-has-children.is-open > .sub-menu { display:block; position:static; box-shadow:none; border:0; background:var(--paper); }
  .fnfm-sub-toggle { display:block; border:0; border-bottom:1px solid var(--line); background:transparent; cursor:pointer; position:relative; }
  .fnfm-sub-toggle::before { content:""; position:absolute; left:50%; top:50%; width:8px; height:8px; margin:-6px 0 0 -4px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
  .fnfm-nav .fnfm-cta { margin:12px 0 0; }
  .fnfm-nav .menu > li.fnfm-cta > a { display:block; text-align:center; border-bottom:0; }
  .fnfm-lead { gap:28px; padding-top:24px; }
  .fnfm-lead__thumb { height:220px; }
  .fnfm-lead__title { font-size:28px; }
  .fnfm-campaign h2 { font-size:26px; }
  .fnfm-pagehead h1 { font-size:32px; }
  .fnfm-section-head h2 { font-size:24px; }
  .fnfm-sidebar { max-width:none; }
}
