@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap');

:root {
  --primary: #004225;
  /* British Racing Green */
  --primary-dark: #002b18;
  --accent: #cdb980;
  /* Muted Gold */
  --bg: #f0ebe3;
  /* Shadowy Off-White */
  --bg-light: #f9f8f5;
  /* Very Light shadowy off-white */
  --surface: #ffffff;
  --text: #050505;
  --border-width: 3px;
  --shadow-heavy: 6px 6px 0px #000;
  --font-serif: "EB Garamond", serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: text;
  margin: 0;
  padding: 0;
}

body {
  background-color: #111;
  font-family: var(--font-serif);
  color: var(--text);
  height: 100vh;
  min-height: 100dvh;
  /* Mobile viewport fix */
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
}

/* Header System */
header {
  background-color: var(--primary);
  color: var(--bg);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
  z-index: 100;
  border-bottom: var(--border-width) solid #000;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.icon-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Main Content Area */
main {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 60px);
}

/* HUB COMPONENTS */
.hero-block {
  position: relative;
  height: 220px;
  background-image: url('icons/hero.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #5d4037;
  color: white;
  margin-bottom: 20px;
  border-bottom: var(--border-width) solid #000;
}

.hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
}

.hero-text h2 {
  font-size: 2.2rem;
  letter-spacing: 0.2rem;
  margin: 0;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1rem;
  font-style: italic;
  font-family: 'EB Garamond', serif;
  text-transform: lowercase;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.section-label {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  font-size: 0.9rem;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 2px;
  border-bottom: var(--border-width) solid #000;
}

.grid-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: var(--border-width) solid #000;
}

.cat-item {
  padding: 25px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  text-align: center;
  background: var(--bg-light);
  cursor: pointer;
}

.cat-item:nth-child(even) {
  border-right: none;
}

.cat-item svg {
  width: 35px;
  height: 35px;
  fill: var(--primary);
  margin-bottom: 15px;
}

/* Category images */
.cat-item img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  filter: sepia(0.3);
}

.cat-item span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: bold;
}

/* Article List */
.art-item {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 15px;
  background: var(--bg);
  cursor: pointer;
}

.art-item:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.art-num {
  font-size: 2.5rem;
  color: rgba(0, 0, 0, 0.1);
  font-weight: 900;
  width: 40px;
}

.art-info h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.art-info .meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #666;
}

/* Article View Appearance */
.article-full {
  background-color: var(--bg-light);
  min-height: 100%;
}

.article-header-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-bottom: var(--border-width) solid #000;
}

.article-content-pad {
  padding: 30px;
  font-size: 1.25rem;
  line-height: 1.7;
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 15px;
}

.article-content-pad h1 {
  font-size: 2.2rem;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0;
  flex: 1;
}

.translate-btn {
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.translate-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
}

.translate-btn svg {
  width: 24px;
  height: 24px;
}

.article-content-pad p {
  margin-bottom: 2rem;
  text-align: justify;
}

.lead-text {
  font-size: 1.4rem;
  font-style: italic;
}

.dropcap {
  float: left;
  font-size: 4rem;
  line-height: 0.7;
  margin-right: 12px;
  margin-top: 10px;
  color: var(--primary);
  font-weight: 900;
}

.separator {
  text-align: center;
  font-size: 2.5rem;
  color: var(--accent);
  margin: 3rem 0;
}

/* View Indicator - diamonds in right corner */
.view-indicator {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.5rem;
  color: var(--primary);
  opacity: 0.5;
  letter-spacing: 2px;
}

.art-item {
  position: relative;
}

.art-item.read {
  opacity: 0.8;
}

.art-item.read .art-num {
  color: var(--primary);
  opacity: 0.4;
}

.quote-block {
  margin: 3rem 0;
  padding: 25px;
  background-color: var(--bg);
  border-left: 5px solid var(--primary);
  font-style: italic;
}

figure {
  margin: 3rem 0;
}

figure img {
  width: 100%;
  border: var(--border-width) solid #000;
  box-shadow: var(--shadow-heavy);
}

figcaption {
  font-size: 0.8rem;
  margin-top: 10px;
  text-align: center;
  color: #555;
}

.article-image-container {
  margin: 0 0 2rem 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.article-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  filter: sepia(0.4) contrast(1.1) brightness(0.9);
  /* "Wooden" feel enhancement */
  border: 2px solid #5d4037;
}

/* Utils */
.hidden {
  display: none !important;
}

::-webkit-scrollbar {
  width: 0;
}