/*
 * Application Styles
 */

/* =========================
   1. IMPORTS
========================= */

@import "actiontext";
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@300;400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caramel&display=swap');


/* =========================
   2. DESIGN SYSTEM (TOKENS)
========================= */

:root {
  /* Colors */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-muted: #888;
  --color-border: #eee;
  --color-text: #111111;

  --color-primary: #f97316;
  --color-primary-dark: #ea580c;

  --color-success: #16a34a;
  --color-success-dark: #15803d;

  --color-danger: #dc2626;
  --color-danger-dark: #b91c1c;

  /* Typography */
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;

  /* Spacing */
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 16px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;
}




/* =========================
   3. RESET & BASE
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--font-serif);
}


/* =========================
   4. LAYOUT
========================= */

main,
.main-content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  width: 100%;
}


/* =========================
   NAVBAR
========================= */

header {
  background-color: black;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

/* pushes menu to the right */
.nav-spacer {
  flex: 1;
}

/* =========================
   BRAND (GLASS BLOG)
========================= */

nav > a:first-child {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  text-decoration: none;
  color: white;
}

/* =========================
   DROPDOWN WRAPPER
========================= */

.dropdown {
  position: relative;
  display: inline-block;
}

/* menu button (☰) */
.dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Caramel', cursive;
  font-size: 2rem;
  color: white;
}

/* =========================
   DROPDOWN MENU
========================= */

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  min-width: 160px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.4rem 0;
  z-index: 1000;

  max-height: 80vh;
  overflow-y: auto;
}

/* open via JS */
.dropdown.open .dropdown-content {
  display: block;
}

/* hover for desktop */
@media (min-width: 769px) {
  .dropdown:hover .dropdown-content {
    display: block;
  }
}

/* mobile positioning */
@media (max-width: 768px) {
  .dropdown-content {
    right: 0;
    left: auto;
  }
}

/* =========================
   DROPDOWN LINKS
========================= */

.dropdown-content a {
  display: block;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.dropdown-content a:hover {
  background-color: #f9f9f9;
}

/* =========================
   USER LABEL
========================= */

.nav-user {
  font-size: 0.85rem;
  color: var(--color-muted);
  white-space: nowrap;
}
/* =========================
   6. HERO
========================= */

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: 3rem;
  letter-spacing: 2px;
}


  /* =========================
    7. FOOTER
  ========================= */

  footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-muted);
    width: 100%;
  }


/* =========================
   8. POSTS
========================= */

.post-card {
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
}

.post-card h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.post-card h2 a {
  text-decoration: none;
  color: var(--color-text);
}

.post-card h2 a:hover {
  color: var(--color-muted);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.post-snippet {
  color: #444;
  margin-bottom: 1rem;
}

.read-more {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-text);
}

.read-more:hover {
  color: var(--color-muted);
}

.trix-content img {
  height: auto;
  border-radius: 8px;
  max-width: 100%;
}

/* Small image */
.trix-content img.img-small {
  width: 250px;
}

/* Medium image */
.trix-content img.img-medium {
  width: 500px;
}

/* Large / full width image */
.trix-content img.img-large {
  width: 100%;
}

.trix-content img {
  cursor: pointer;
}


/* =========================
   9. BUTTONS
========================= */

.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background-color: var(--color-text);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--color-primary);
}

.btn-secondary {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--color-text);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #f5f5f5;
}

.btn-danger {
  padding: 0.5rem 1rem;
  background-color: var(--color-danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-danger:hover {
  background-color: var(--color-danger-dark);
}

.btn-publish {
  padding: 0.5rem 1rem;
  background-color: var(--color-success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-publish:hover {
  background-color: var(--color-success-dark);
}

.btn-small {
  padding: 5px 10px;
  background-color: var(--color-text);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-small:hover {
  background-color: var(--color-primary);
}


/* =========================
   10. FORMS
========================= */

form {
  max-width: 600px;
  margin: 0 auto;
}

form div {
  margin-bottom: 1.2rem;
}

form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-sans);
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--color-text);
}

form input[type="submit"] {
  width: auto;
  background-color: var(--color-text);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

form input[type="submit"]:hover {
  background-color: #444;
}

/* Checkbox alignment fix */
.field p {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field p label {
  display: inline;
  margin: 0;
}

.field input[type="checkbox"] {
  width: auto;
  margin: 0;
}


/* =========================
   11. FLASH MESSAGES
========================= */

.notice {
  background-color: #f0fdf4;
  color: #166534;
  padding: 0.75rem 2rem;
  text-align: center;
}

.alert {
  background-color: #fef2f2;
  color: var(--color-danger);
  padding: 0.75rem 2rem;
  text-align: center;
}


/* =========================
   12. POST ACTIONS
========================= */

.post-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.post-actions-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}


/* =========================
   13. COMMENTS & LIKES
========================= */

.likes-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.likes-section p {
  margin: 0;
}

.comment-form {
  display: none;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.2s ease;
}

.comment-form.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}


/* =========================
   14. TABLES (USERS ADMIN)
========================= */

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.users-table thead {
  background: #f9f9f9;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.users-table tr:hover {
  background: #fafafa;
}

.users-table form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.users-table select {
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid #ddd;
  font-size: 0.9rem;
  background: white;
}


/* =========================
   15. BADGES
========================= */

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.admin {
  background: #fee2e2;
  color: #991b1b;
}

.role-badge.author {
  background: #e0f2fe;
  color: #075985;
}


/* =========================
   16. RESPONSIVE
========================= */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  nav {
    flex-wrap: wrap;
    gap: 1rem;
  }
}


/* =========================
   17. UTILITIES
========================= */

h1 {
  margin-top: 1rem;
}

#post-content p,
.post-body p {
  text-align: justify;
}

.trix-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

/* BLOG GRID */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* BLOG CARDS */
.blog-card {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 2rem;
  margin-bottom: 1.5rem;

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.blog-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.blog-card h3 a {
  text-decoration: none;
  color: #222;
}

.blog-card h3 a:hover {
  color: #f97316;
}

/* Base thumbnail styling — still used as-is on the homepage
   .post-card (float right, sits beside the text). */
.post-thumbnail {
  float: right;
  margin-left: 0.9rem;
  margin-bottom: 0.4rem;
}

.post-thumbnail-img {
  width: 250px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

/* Override for blog listing cards only: no float, full width,
   and pushed below all the text via flex order. */
.blog-card .post-thumbnail {
  float: none;
  margin: 1rem 0 0;
  order: 99;
}

.blog-card .post-thumbnail-img {
  width: 100%;
  height: 180px;
}

/* Remove image naming inside trix,*/

.attachment__caption {
  display: none;
}







/* =========================
   18. ADMIN DASHBOARD
========================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.dashboard-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
  transition: none;
  
}

.dashboard-card h3 {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dashboard-card p {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--color-text);
}



.hero-logo {
  max-width: 400px; /* smaller than before */
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 1rem;
}

.post-card h2 a {
  color: #7b3c14;
  text-decoration: none;
}

.post-card h2 a:hover {
  color: #5a2b0f;
}

.post-meta,
.post-snippet {
  color: #7b3c14;
}

.dashboard-card--clickable {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dashboard-card--clickable {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card--clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  cursor: pointer;
}

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filters a {
  text-decoration: none;
  color: #7b3c14;
  font-weight: 500;
}

.filters a.active {
  border-bottom: 2px solid #7b3c14;
}

.post-card h2 a {
  color: #111;
}

.post-snippet,
.post-meta,
.post-body {
  color: #111;
}

footer p {
  text-align: center !important;
}

/* Front page image */
.home-cover-page {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: calc(var(--space-xl) * -1);
  margin-bottom: calc(var(--space-xl) * -1);
}

.home-cover-page img {
  width: 100%;
  height: auto;
  display: block;
}

.home-cover-button {
  position: fixed;
  top: 85%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
}