/*
Theme Name: RML Editorial
Theme URI: https://example.com/rml-editorial
Author: RML
Description: A refined, responsive editorial portfolio theme for biographies, articles, books, media, and long-form writing.
Version: 1.0.3
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: rml-editorial
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, portfolio, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --rml-accent: #c89d68;
  --rml-ink: #3e3d3c;
  --rml-heading: #151412;
  --rml-muted: #8b8986;
  --rml-line: #e8e6e2;
  --rml-paper: #fff;
  --rml-content: 1460px;
  --rml-reading: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--rml-paper);
  color: var(--rml-ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rml-accent); text-decoration: none; transition: color .2s ease; }
a:hover, a:focus { color: #9d7444; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #9d7444; outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px;
  overflow: hidden; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus { clip: auto !important; clip-path: none; display: block; height: auto; left: 10px; top: 10px; width: auto; z-index: 100000; }

/* Navigation */
.site-header {
  position: relative;
  z-index: 20;
  min-height: 50px;
  border-bottom: 1px solid var(--rml-line);
  box-shadow: 0 2px 7px rgba(0,0,0,.045);
  background: rgba(255,255,255,.98);
}
.header-inner {
  width: 1080px;
  min-height: 50px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}
.site-navigation { display: flex; align-items: stretch; flex: 1; }
.primary-menu, .primary-menu ul { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; align-items: stretch; gap: 44px; }
.primary-menu > li { display: flex; position: relative; align-items: stretch; }
.primary-menu > li > a {
  display: flex;
  align-items: center;
  color: var(--rml-heading);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current_page_item > a,
.primary-menu > li.current-menu-ancestor > a { color: var(--rml-accent); }
.primary-menu .sub-menu {
  display: none;
  position: absolute;
  left: -20px;
  top: 100%;
  min-width: 220px;
  padding: 10px 0;
  border: 1px solid var(--rml-line);
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}
.primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu { display: block; }
.primary-menu .sub-menu a { display: block; padding: 10px 20px; color: var(--rml-heading); font-size: 14px; }
.header-tools { display: flex; margin-left: auto; align-items: stretch; }
.social-links { display: flex; align-items: center; gap: 13px; padding: 0 22px; }
.social-links a { color: #050505; font-size: 18px; line-height: 1; }
.header-search { display: flex; align-items: center; border-left: 1px solid var(--rml-line); min-width: 275px; }
.search-form { display: flex; align-items: center; width: 100%; }
.search-field { width: 100%; padding: 13px 8px 13px 24px; border: 0; outline: 0; color: var(--rml-ink); font-style: italic; background: transparent; }
.search-submit { padding: 12px 18px 12px 8px; border: 0; color: var(--rml-ink); background: transparent; cursor: pointer; }
.menu-toggle { display: none; border: 0; padding: 0 4px; background: none; color: var(--rml-heading); font-size: 28px; cursor: pointer; }

/* Masthead */
.site-branding {
  min-height: 246px;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--rml-line);
  text-align: center;
}
.custom-logo { width: auto; max-width: 420px; max-height: 115px; }
.site-title { margin: 0; font-size: clamp(36px, 3vw, 52px); font-weight: 300; letter-spacing: .015em; line-height: 1.1; }
.site-title a { color: #232220; }
.site-description { margin: 10px 0 0; color: var(--rml-muted); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }

/* Main layouts */
.site-main { min-height: 55vh; }
.content-shell { width: 1080px; margin: 0 auto; padding: 86px 0 74px; }
.content-shell--narrow { width: 1080px; }
.page-header { margin-bottom: 52px; text-align: center; }
.page-title, .entry-title {
  margin: 0;
  color: var(--rml-heading);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3vw, 44px);
  font-weight: 400;
  line-height: 1.2;
}
.archive-description { max-width: 720px; margin: 16px auto 0; color: var(--rml-muted); }
.entry-content { font-size: 19px; }
.entry-content::after { display: table; clear: both; content: ""; }
.entry-content > * { margin-top: 0; margin-bottom: 1.35em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  margin-top: 1.9em;
  margin-bottom: .7em;
  color: var(--rml-heading);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.25;
}
.entry-content h2 { font-size: 32px; }
.entry-content h3 { font-family: inherit; font-size: 21px; font-weight: 700; }
.entry-content strong { font-weight: 700; }
.entry-content em { font-style: italic; }
.entry-content ul, .entry-content ol { padding-left: 1.35em; }
.entry-content li { margin-bottom: .55em; }
.entry-content hr { margin: 42px 0; border: 0; border-top: 1px solid var(--rml-line); }
.entry-content blockquote { margin: 2em 0; padding-left: 28px; border-left: 3px solid var(--rml-accent); font-family: Georgia, serif; font-size: 24px; }
.entry-content .wp-block-image.alignright, .entry-content img.alignright { float: right; max-width: 34%; margin: 12px 0 28px 60px; }
.entry-content .is-style-rounded img, .entry-content img.is-style-rounded { border-radius: 50%; }
.entry-content .wp-block-heading + p { margin-top: -.25em; }
.entry-content a { font-weight: 600; }
.entry-footer { margin-top: 45px; padding-top: 20px; border-top: 1px solid var(--rml-line); color: var(--rml-muted); font-size: 14px; }
.edit-link { margin-left: 12px; }

/* Long-form posts and blog index */
.two-column-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 86px; }
.post-card { margin-bottom: 66px; padding-bottom: 52px; border-bottom: 1px solid var(--rml-line); }
.post-card .entry-title { font-size: 38px; }
.post-card .entry-title a { color: var(--rml-heading); }
.post-card .entry-meta, .single-post .entry-meta { margin: 16px 0 34px; color: var(--rml-muted); font-size: 14px; font-style: italic; text-align: center; }
.post-card .entry-summary { font-size: 18px; }
.post-thumbnail { margin-bottom: 30px; }
.post-thumbnail img { width: 100%; }
.read-more { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.single-post .entry-header { margin-bottom: 34px; text-align: center; }
.single-post .entry-content { font-size: 19px; }

/* Sidebar */
.widget { margin-bottom: 42px; }
.widget-title {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid var(--rml-accent);
  color: var(--rml-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .15em;
  text-align: center;
  text-transform: uppercase;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px dotted #d8d4cf; }
.widget li a { color: var(--rml-ink); }
.widget li a:hover { color: var(--rml-accent); }
.widget_archive li { color: var(--rml-muted); }

/* Navigation and comments */
.posts-navigation, .post-navigation { margin: 48px 0; padding-top: 28px; border-top: 1px solid var(--rml-line); }
.nav-links { display: flex; justify-content: space-between; gap: 30px; }
.nav-links a { font-weight: 600; }
.comments-area { margin-top: 60px; padding-top: 36px; border-top: 1px solid var(--rml-line); }
.comments-title { color: var(--rml-heading); font-family: Georgia, serif; font-weight: 400; }
.comment-list { padding-left: 0; list-style: none; }
.comment-body { margin-bottom: 28px; }
.comment-meta { font-size: 14px; }
.comment-content { margin-top: 12px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.comment-form input:not([type="submit"]), .comment-form textarea { width: 100%; padding: 12px; border: 1px solid #d7d3ce; }
.submit { padding: 12px 22px; border: 1px solid var(--rml-accent); color: var(--rml-heading); background: transparent; cursor: pointer; }

/* Footer */
.site-footer { border-top: 1px solid var(--rml-line); color: var(--rml-muted); }
.footer-inner { width: min(var(--rml-content), calc(100% - 64px)); margin: 0 auto; padding: 30px 0; display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.footer-menu { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }

/* WordPress defaults */
.alignleft { float: left; margin: 8px 30px 20px 0; }
.alignright { float: right; margin: 8px 0 20px 30px; }
.aligncenter { display: block; margin-right: auto; margin-left: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { color: var(--rml-muted); font-size: 13px; }
.sticky { position: relative; }
.bypostauthor { position: relative; }
.pagination .nav-links { justify-content: center; }
.page-numbers { padding: 7px 11px; border: 1px solid var(--rml-line); }
.page-numbers.current { border-color: var(--rml-accent); color: var(--rml-heading); }
.not-found { text-align: center; }
.not-found .search-form { max-width: 520px; margin: 30px auto; border: 1px solid var(--rml-line); }

@media (max-width: 1050px) {
  .header-inner { width: min(100% - 40px, var(--rml-content)); }
  .content-shell--narrow { width: min(100% - 40px, var(--rml-content)); }
  .primary-menu { gap: 25px; }
  .header-search { min-width: 215px; }
  .two-column-layout { gap: 48px; grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 820px) {
  body { font-size: 17px; }
  .site-header { min-height: 50px; }
  .header-inner { position: relative; min-height: 50px; align-items: center; }
  .menu-toggle { display: block; }
  .site-navigation { flex: 0; }
  .primary-menu {
    display: none;
    position: absolute;
    left: -20px;
    right: -20px;
    top: 50px;
    padding: 12px 20px 20px;
    border-top: 1px solid var(--rml-line);
    background: #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,.06);
  }
  .site-navigation.is-open .primary-menu { display: block; }
  .primary-menu > li, .primary-menu > li > a { display: block; }
  .primary-menu > li > a { padding: 11px 0; }
  .primary-menu .sub-menu { display: block; position: static; padding: 0 0 4px 18px; border: 0; box-shadow: none; }
  .header-search { min-width: 0; width: 52px; border-left: 0; }
  .header-search .search-field { position: absolute; left: 0; right: 0; top: 50px; display: none; width: 100%; padding: 16px 20px; border: 1px solid var(--rml-line); background: #fff; }
  .header-search.is-open .search-field { display: block; }
  .search-submit { margin-left: auto; padding: 12px; }
  .social-links { margin-left: auto; padding: 0 10px; }
  .site-branding { min-height: 185px; }
  .content-shell { width: min(100% - 40px, var(--rml-content)); padding: 58px 0; }
  .page-header { margin-bottom: 38px; }
  .two-column-layout { display: block; }
  .widget-area { margin-top: 65px; padding-top: 40px; border-top: 1px solid var(--rml-line); }
  .entry-content .wp-block-image.alignright, .entry-content img.alignright { float: none; max-width: 310px; margin: 0 auto 30px; }
}

@media (max-width: 520px) {
  .header-inner { width: calc(100% - 28px); }
  .social-links { gap: 8px; padding: 0 5px; }
  .site-branding { min-height: 150px; padding: 38px 20px; }
  .site-title { font-size: 36px; }
  .content-shell { width: calc(100% - 36px); padding: 44px 0; }
  .page-title, .entry-title, .post-card .entry-title { font-size: 31px; }
  .entry-content, .single-post .entry-content { font-size: 17px; }
  .footer-inner { width: calc(100% - 36px); flex-direction: column; }
  .nav-links { flex-direction: column; }
}
