/*
Theme Name: Dugout
Description: A theme for travel baseball teams, built to pair with the Travel Ball Team Manager plugin. Set team colors in Appearance → Customize.
Version: 4.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: dugout
*/

:root {
	--tbt-primary: #17305a;
	--tbt-accent: #c22f2f;
	--tbt-ink: #1c2230;
	--tbt-muted: #5d6676;
	--tbt-rule: #dbe4d6;
	--tbt-tint: #f3f7f0;
	--tbt-paper: #ffffff;
	--dg-page: #fbfcfa;
	--dg-measure: 72ch;
	--dg-wide: 1180px;
	--tbt-num-font: "Graduate", "Rockwell", serif;
	--tbt-ui-font: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
	--dg-body-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* Fonts are bundled with the theme (SIL Open Font License), no outside requests. */
@font-face { font-family: "Graduate"; src: url(fonts/Graduate-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url(fonts/IBMPlexSansCondensed-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url(fonts/IBMPlexSansCondensed-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url(fonts/IBMPlexSansCondensed-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--dg-page); color: var(--tbt-ink); font-family: var(--dg-body-font); font-size: 1.0625rem; line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--tbt-primary); text-underline-offset: 0.15em; }
a:hover { color: var(--tbt-accent); }
:focus-visible { outline: 3px solid var(--tbt-accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--tbt-ui-font); line-height: 1.15; margin: 1.6em 0 0.5em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; clip: auto; width: auto; height: auto; background: #fff; padding: 10px 14px; z-index: 1000; }

.dg-wrap { max-width: var(--dg-wide); margin: 0 auto; padding: 0 20px; }

/* Header: team color bar with scorebook-paper ruling */
.dg-header { background: var(--tbt-primary); color: #fff; border-bottom: 5px solid var(--tbt-accent); }
.dg-header .dg-wrap { display: flex; align-items: center; gap: 18px; min-height: 76px; flex-wrap: wrap; }
.dg-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.dg-brand:hover { color: #fff; }
.dg-brand img { max-height: 54px; width: auto; }
.dg-brand-name { font-family: var(--tbt-num-font); font-size: 1.55rem; line-height: 1; }
.dg-brand-tag { display: block; font-family: var(--tbt-ui-font); font-size: 0.85rem; opacity: 0.8; margin-top: 3px; }
.dg-nav { margin-left: auto; }
.dg-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.dg-nav a { display: block; padding: 10px 12px; color: #fff; text-decoration: none; font-family: var(--tbt-ui-font); font-weight: 600; border-radius: 4px; }
.dg-nav a:hover, .dg-nav .current-menu-item > a, .dg-nav .current_page_item > a { background: rgba(255,255,255,0.14); color: #fff; }
.dg-menu-toggle { display: none; margin-left: auto; background: none; border: 2px solid rgba(255,255,255,0.6); color: #fff; font: 600 1rem var(--tbt-ui-font); padding: 8px 14px; border-radius: 6px; }

/* Masthead on the home page: the team name on scorebook paper */
.dg-mast { background-color: var(--tbt-paper); background-image: linear-gradient(var(--tbt-rule) 1px, transparent 1px), linear-gradient(90deg, var(--tbt-rule) 1px, transparent 1px); background-size: 28px 28px; border-bottom: 2px solid var(--tbt-ink); }
.dg-mast .dg-wrap { padding-top: 48px; padding-bottom: 40px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; }
.dg-mast-logo img { max-height: 150px; width: auto; display: block; }
.dg-mast h1 { font-family: var(--tbt-num-font); font-weight: 400; font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 0.95; margin: 0; color: var(--tbt-primary); letter-spacing: 0.01em; }
.dg-mast p { margin: 10px 0 0; font-family: var(--tbt-ui-font); font-size: 1.2rem; color: var(--tbt-ink); max-width: 46ch; }

.dg-home { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; padding-top: 12px; padding-bottom: 48px; }
.dg-home h2 { font-size: 1.35rem; margin-top: 28px; padding-bottom: 6px; border-bottom: 2px solid var(--tbt-ink); }
.dg-home .tbt-next h3 { font-size: 1rem; color: var(--tbt-muted); margin: 18px 0 4px; }
.dg-quick { list-style: none; padding: 0; margin: 0; }
.dg-quick li { border-bottom: 1px solid var(--tbt-rule); }
.dg-quick a { display: flex; justify-content: space-between; padding: 12px 2px; text-decoration: none; font-family: var(--tbt-ui-font); font-weight: 600; font-size: 1.1rem; color: var(--tbt-ink); }
.dg-quick a:hover { color: var(--tbt-accent); }

/* Content */
.dg-main { padding: 8px 0 56px; min-height: 50vh; }
.dg-page-title { margin-top: 36px; }
.dg-content:not(.dg-wide-content) > *:not(.alignwide):not(.alignfull) { max-width: var(--dg-measure); }
.dg-content .alignwide { max-width: var(--dg-wide); }
.dg-posts { list-style: none; padding: 0; margin: 0; }
.dg-posts li { padding: 14px 0; border-bottom: 1px solid var(--tbt-rule); }
.dg-posts a { font-family: var(--tbt-ui-font); font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--tbt-ink); }
.dg-posts time { display: block; font-size: 0.9rem; color: var(--tbt-muted); }
.dg-entry-meta { color: var(--tbt-muted); font-size: 0.95rem; }
.dg-pagination { margin-top: 24px; font-family: var(--tbt-ui-font); }

/* Footer */
.dg-footer { background: var(--tbt-ink); color: #d9dde4; font-family: var(--tbt-ui-font); }
.dg-footer .dg-wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.dg-footer a { color: #fff; }
.dg-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }

/* The scorer gets the whole screen */
body.dg-scorer .dg-main { padding: 0; }
body.dg-scorer .dg-page-title { display: none; }
body.dg-scorer .dg-header .dg-wrap { min-height: 52px; }
body.dg-scorer .dg-brand-name { font-size: 1.1rem; }

@media (max-width: 860px) {
	.dg-menu-toggle { display: block; }
	.dg-nav { display: none; width: 100%; margin: 0 0 12px; }
	.dg-nav.is-open { display: block; }
	.dg-nav ul { flex-direction: column; }
	.dg-home { grid-template-columns: 1fr; gap: 0; }
	.dg-mast .dg-wrap { grid-template-columns: 1fr; padding-top: 32px; padding-bottom: 28px; }
	.dg-mast-logo img { max-height: 96px; }
}
@media print {
	.dg-header, .dg-footer, .dg-menu-toggle { display: none; }
}
