/*
Theme Name: ComicFrame
Author: Codex by OpenAI, commissioned by f2x
Description: A lightweight, configurable classic theme for comics, archives, personal sites, and other content-first WordPress installations.
Version: 0.5.0-beta1
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: comicframe
*/

:root {
  --cf-page-bg: #5a302b;
  --cf-content-bg: #f7f1e7;
  --cf-text: #241b18;
  --cf-link: #8a164c;
  --cf-menu-bg: #3b201e;
  --cf-menu-text: #fff8ee;
  --cf-sidebar-bg: #4a2825;
  --cf-sidebar-text: #fff5e6;
  --cf-sidebar-link: #ffd2e5;
  --cf-max-width: 1024px;
  --cf-side-margin: 60px;
  --cf-sidebar-width: 360px;
  --cf-column-gap: 24px;
  --cf-font: Arial, Helvetica, sans-serif;
  --cf-menu-font: Arial, Helvetica, sans-serif;
  --cf-radius: 0;
  --cf-body-size: 16px;
  --cf-title-size: 30px;
  --cf-menu-size: 16px;
  --cf-sidebar-size: 16px;
  --cf-body-weight: 400;
  --cf-title-weight: 700;
  --cf-menu-weight: 400;
  --cf-sidebar-weight: 400;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  color: var(--cf-text);
  background: var(--cf-page-bg);
  font-family: var(--cf-font);
  font-size: var(--cf-body-size);
  font-weight: var(--cf-body-weight);
  line-height: 1.55;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--cf-link); }
a:hover, a:focus { text-decoration-thickness: 2px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus, .skip-link:focus {
  clip: auto; width: auto; height: auto; margin: 8px; padding: 10px 14px;
  background: #fff; color: #111; z-index: 10000;
}

.site-shell {
  width: min(var(--cf-max-width), calc(100% - (2 * var(--cf-side-margin))));
  margin: 0 auto;
  background: var(--cf-content-bg);
}
.site-header { position: relative; min-height: 150px; overflow: hidden; color: #fff; background: #555; border-radius: var(--cf-radius) var(--cf-radius) 0 0; }
.site-header.text-header { display: flex; align-items: center; min-height: 150px; background: linear-gradient(135deg, #4e2a27, #2e1b1a); }
.header-background {
  display: block; width: 100%; height: 150px;
  object-fit: cover; object-position: right center;
}
.site-logo-link, .site-header .custom-logo-link {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  display: block; max-width: 48%; line-height: 0;
}
.site-logo, .site-header .custom-logo { display: block; width: min(100%, var(--cf-logo-width, 500px)); height: auto; }
.text-branding { position: relative; z-index: 2; display: flex; align-items: center; gap: 20px; padding: 24px; }
.text-branding .custom-logo-link { position: static; max-width: none; transform: none; }
.text-branding .site-title { margin: 0; font-size: 2.2rem; }
.text-branding .site-title a { color: inherit; text-decoration: none; }
.text-branding .site-description { margin: 4px 0 0; }

.site-navigation { background: var(--cf-menu-bg); color: var(--cf-menu-text); font-family: var(--cf-menu-font); font-size: var(--cf-menu-size); font-weight: var(--cf-menu-weight); }
.menu-toggle { display: none; width: 100%; border: 0; padding: 12px 16px; color: inherit; background: inherit; font: inherit; text-align: left; }
.primary-menu, .footer-menu { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.primary-menu a { display: block; padding: 11px 16px; color: var(--cf-menu-text); text-decoration: none; }
.primary-menu a:hover, .primary-menu a:focus, .primary-menu .current-menu-item > a { background: rgba(255,255,255,.14); }
.primary-menu .sub-menu { margin: 0; padding-left: 18px; list-style: none; }

@media (min-width: 721px) {
  .site-navigation { position: relative; z-index: 1000; }
  .primary-menu li { position: relative; }
  .primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1001;
    display: none;
    min-width: 220px;
    margin: 0;
    padding: 0;
    background: var(--cf-menu-bg);
    box-shadow: 0 6px 12px rgba(0,0,0,.35);
  }
  .primary-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
  }
  .primary-menu li:hover > .sub-menu,
  .primary-menu li:focus-within > .sub-menu {
    display: block;
  }
  .primary-menu .sub-menu a {
    min-width: 220px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,.1);
    white-space: nowrap;
  }
  .primary-menu > .menu-item-has-children > a::after,
  .primary-menu > .page_item_has_children > a::after {
    content: " \25BE";
  }
  .primary-menu .sub-menu .menu-item-has-children > a::after,
  .primary-menu .sub-menu .page_item_has_children > a::after {
    float: right;
    margin-left: 12px;
    content: "\25B8";
  }
}

.site-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--cf-sidebar-width); gap: var(--cf-column-gap); align-items: start; }
.content-area { min-width: 0; padding: 24px; background: var(--cf-content-bg); border-radius: var(--cf-radius); }
.widget-area {
  width: var(--cf-sidebar-width); padding: 15px;
  color: var(--cf-sidebar-text); background: var(--cf-sidebar-bg);
  overflow: visible;
  border-radius: var(--cf-radius);
  font-size: var(--cf-sidebar-size);
  font-weight: var(--cf-sidebar-weight);
}
.widget { margin: 0 0 28px; border-radius: var(--cf-radius); }
.widget:last-child { margin-bottom: 0; }
.widget-title { margin: 0 0 10px; color: inherit; }
.widget-area a { color: var(--cf-sidebar-link); }
.widget-area img { max-width: 100%; height: auto; }
.widget-area ul { margin: 0; padding-left: 20px; }

.post-card { margin: 0 0 36px; padding: 0 0 30px; border-bottom: 1px solid rgba(0,0,0,.2); }
.post-card:last-child { border-bottom: 0; }
.entry-title { margin: 0 0 5px; font-size: var(--cf-title-size); font-weight: var(--cf-title-weight); line-height: 1.2; overflow-wrap: anywhere; }
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover, .entry-title a:focus { text-decoration: underline; }
.entry-meta { margin-bottom: 18px; font-size: .9rem; opacity: .76; }
.entry-content::after { display: table; clear: both; content: ""; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }
.more-link { white-space: nowrap; }
.page-header { margin-bottom: 28px; }
.page-title { margin-top: 0; }
.post-navigation, .posts-navigation, .pagination { margin: 30px 0; }
.nav-links { display: flex; justify-content: space-between; gap: 20px; }
.nav-next { margin-left: auto; text-align: right; }
.comic-marker-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  clear: both;
  margin: 18px 0 22px;
  padding: 10px 0;
  border-top: 1px solid rgba(0,0,0,.2);
  border-bottom: 1px solid rgba(0,0,0,.2);
  align-items: flex-start;
  font-weight: bold;
}
.comic-nav-item { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; min-width: 0; padding: 6px; border-radius: var(--cf-radius); text-align: center; text-decoration: none; }
.comic-nav-item:hover, .comic-nav-item:focus { background: rgba(0,0,0,.07); }
.comic-nav-image { display: block; max-width: 100%; height: auto; }
.comic-nav-title { display: block; margin-top: 4px; font-size: .82em; font-weight: normal; overflow-wrap: anywhere; }
.comment-list { padding-left: 24px; }
.comment-body { margin-bottom: 22px; }
textarea, input[type="text"], input[type="email"], input[type="url"], input[type="search"] { max-width: 100%; padding: 8px; }
button, input[type="submit"] { cursor: pointer; padding: 8px 14px; }

.site-footer { padding: 18px 24px; color: var(--cf-menu-text); background: var(--cf-menu-bg); border-radius: 0 0 var(--cf-radius) var(--cf-radius); }
.footer-menu { margin-bottom: 10px; gap: 16px; }
.footer-menu a { color: inherit; }
.site-info { font-size: .9rem; }

.ghettobox-overlay {
  position: fixed; inset: 0; z-index: 99999; display: none;
  align-items: center; justify-content: center; padding: 48px 20px 20px;
  background: rgba(17,17,17,.96);
}
.ghettobox-overlay.is-open { display: flex; }
.ghettobox-stage { max-width: 100%; max-height: 100%; overflow: auto; text-align: center; }
.ghettobox-image { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.ghettobox-caption { margin: 10px 0 0; color: #fff; }
.ghettobox-close {
  position: absolute; top: 8px; right: 12px; min-width: 44px; min-height: 44px;
  border: 2px solid #fff; border-radius: var(--cf-radius); color: #fff; background: #111;
  font-size: 28px; line-height: 1;
}
body.ghettobox-open { overflow: hidden; }

@media (max-width: 720px) {
  .site-logo-link, .site-header .custom-logo-link { max-width: 52%; }
  .menu-toggle { display: block; }
  .primary-menu { display: none; }
  .primary-menu.is-open { display: block; }
  .primary-menu a { border-top: 1px solid rgba(255,255,255,.12); }
  .primary-menu .sub-menu { position: static; display: block; padding-left: 18px; box-shadow: none; }
  .content-area { padding: 18px 15px; }
  .nav-links { display: block; }
  .nav-next { margin-top: 14px; text-align: left; }
  .comic-marker-navigation { gap: 12px; }
  .comic-nav-title { display: none; }
}

@media print {
  body, .site-shell, .content-area { background: #fff; color: #000; }
  .site-navigation, .widget-area, .site-footer, .post-navigation, .comments-area, .comic-marker-navigation, .ghettobox-overlay { display: none; }
  .site-layout { display: block; }
  a { color: #000; text-decoration: none; }
}
